Table of Contents

Interface IFlexalonNode

Namespace
Flexalon
Assembly
Flexalon.dll

Represents a node in the Flexalon layout tree.

public interface IFlexalonNode

Properties

Adapter

Returns the active adapter for this node.

IFlexalonAdapter Adapter { get; }

Property Value

IFlexalonAdapter

Children

The children of this layout node.

IReadOnlyList<IFlexalonNode> Children { get; }

Property Value

IReadOnlyList<IFlexalonNode>

ChildrenDirty

Whether this node's child placement inputs changed. Local to this node; cleared after arrangement.

bool ChildrenDirty { get; }

Property Value

bool

Constraint

Returns the constraint of this node.

IFlexalonConstraint Constraint { get; }

Property Value

IFlexalonConstraint

DelegateLayoutToParent

Whether this node delegates its child layout to its current parent.

bool DelegateLayoutToParent { get; set; }

Property Value

bool

Dirty

True if this node is dirty.

bool Dirty { get; }

Property Value

bool

DisableChildDetection

When true, Flexalon doesn't add or remove this node's children when its GameObject children change. Use this when a script manages the node's children, as the Flexalon Virtualizer does.

bool DisableChildDetection { get; set; }

Property Value

bool

EnableSpatialQueries

Enables SpatialQuery by keeping an index of the direct children's target bounds, built on the next query after this node arranges. Membership edits preserve the other children's existing bounds without computing layout. Defaults to false. Disabling releases the index.

bool EnableSpatialQueries { get; set; }

Property Value

bool

FlexalonObject

Returns the FlexalonObject of this node.

IFlexalonObject FlexalonObject { get; }

Property Value

IFlexalonObject

GameObject

The GameObject associated with this node.

GameObject GameObject { get; }

Property Value

GameObject

HasFlexalonObject

Returns true if FlexalonObject is set.

bool HasFlexalonObject { get; }

Property Value

bool

HasResult

Has layout ever run on this node?

bool HasResult { get; }

Property Value

bool

Index

The index of this node in its parent's Children list.

int Index { get; }

Property Value

int

IsDragging

True when this node is being dragged.

bool IsDragging { get; set; }

Property Value

bool

Margin

Returns the assigned margin of this node.

Directions Margin { get; }

Property Value

Directions

Method

Returns the layout method of this node.

IFlexalonLayout Method { get; }

Property Value

IFlexalonLayout

Modifiers

Returns the set of modifiers that apply to layout results.

IReadOnlyList<IFlexalonModifier> Modifiers { get; }

Property Value

IReadOnlyList<IFlexalonModifier>

Offset

Returns the assigned offset of this node relative to its layout position.

Vector3 Offset { get; }

Property Value

Vector3

Padding

Returns the assigned padding of this node.

Directions Padding { get; }

Property Value

Directions

Parent

The parent layout node of this node.

IFlexalonNode Parent { get; }

Property Value

IFlexalonNode

Result

Returns the result of the last layout run.

IFlexalonResult Result { get; }

Property Value

IFlexalonResult

Rotation

Returns the assigned relative rotation of this node.

Quaternion Rotation { get; }

Property Value

Quaternion

Scale

Returns the assigned relative scale of this node.

Vector3 Scale { get; }

Property Value

Vector3

Size

Returns the assigned fixed size of this node.

Vector3 Size { get; }

Property Value

Vector3

SizeOfParent

Returns the assigned size factor of this node relative to the available space.

Vector3 SizeOfParent { get; }

Property Value

Vector3

SkipLayout

True when this node should not skipped when performing layout.

bool SkipLayout { get; }

Property Value

bool

Methods

AddChild(IFlexalonNode)

Adds a child to this layout node.

void AddChild(IFlexalonNode child)

Parameters

child IFlexalonNode

The child to add.

AddModifier(IFlexalonModifier)

Adds a modifier to this node.

void AddModifier(IFlexalonModifier modifier)

Parameters

modifier IFlexalonModifier

CanShrink(int)

Returns true if this node is not filling this axis and has a min size set.

bool CanShrink(int axis)

Parameters

axis int

Returns

bool

Detach()

Removes this node from its parent layout node.

void Detach()

DetachAllChildren()

Removes all children from this layout node.

void DetachAllChildren()

FastSwapChild(IFlexalonNode, int)

Exchanges the child at an index with another node, swapping their allocation and placement without validating sizing or layout settings. The caller guarantees that each node can occupy the other's slot and that neither is an ancestor of the other. Transfers solved layout outputs and recomputes transform targets while retaining each node's actual transform state. Pending layout inside either item is traversed without requesting layout on its parent. A leaf's pending layout flags are not propagated by the swap. Subsequent changes can invalidate layout normally. Changes the layout tree, not the GameObject hierarchy.

IFlexalonNode FastSwapChild(IFlexalonNode replacement, int index)

Parameters

replacement IFlexalonNode

The node to exchange with, which may be detached.

index int

The index of the child to replace.

Returns

IFlexalonNode

The previous child, now in the replacement's old slot or detached.

ForceUpdate()

Forces this node, its parent nodes, and its children nodes to update immediately.

void ForceUpdate()

GetArrangeSize()

Returns the computed size of this node during the arrange step.

Vector3 GetArrangeSize()

Returns

Vector3

GetChild(int)

Returns the child of this layout node.

IFlexalonNode GetChild(int index)

Parameters

index int

The index of the child to return.

Returns

IFlexalonNode

The child at the given index.

GetMaxSize(int, float)

Returns the max size of this node, including margin.

float GetMaxSize(int axis, float parentSize)

Parameters

axis int
parentSize float

Returns

float

GetMeasureSize(int, float)

Returns the computed size of this node during the measure step.

float GetMeasureSize(int axis, float layoutSize)

Parameters

axis int
layoutSize float

Returns

float

GetMeasureSize(Vector3)

Returns the computed size of this node during the measure step.

Vector3 GetMeasureSize(Vector3 layoutSize)

Parameters

layoutSize Vector3

Returns

Vector3

GetMinSize(int, float)

Returns the min size of this node, including margin.

float GetMinSize(int axis, float parentSize)

Parameters

axis int
parentSize float

Returns

float

GetMinSize(Vector3)

Returns the min size of this node, including margin.

Vector3 GetMinSize(Vector3 parentSize)

Parameters

parentSize Vector3

Returns

Vector3

GetSizeType(Axis)

Returns the assigned SizeType of this node.

SizeType GetSizeType(Axis axis)

Parameters

axis Axis

The axis to get the SizeType of.

Returns

SizeType

The SizeType of the given axis.

GetSizeType(int)

Returns the assigned SizeType of this node.

SizeType GetSizeType(int axis)

Parameters

axis int

The axis to get the SizeType of.

Returns

SizeType

The SizeType of the given axis.

GetWorldBoxPosition(Vector3, bool)

Returns the world position of the layout box. Used for gizmos.

Vector3 GetWorldBoxPosition(Vector3 scale, bool includePadding)

Parameters

scale Vector3
includePadding bool

Returns

Vector3

GetWorldBoxScale(bool)

Returns the world scale of the layout box. Used for gizmos.

Vector3 GetWorldBoxScale(bool includeLocalScale)

Parameters

includeLocalScale bool

Returns

Vector3

GetWorldLayoutPosition(Vector3)

Returns the world position of the point this node's layout arranges its children around.

Vector3 GetWorldLayoutPosition(Vector3 scale)

Parameters

scale Vector3

Returns

Vector3

InsertChild(IFlexalonNode, int)

Inserts a child into this layout node. The caller must mark the appropriate layout state dirty.

void InsertChild(IFlexalonNode child, int index)

Parameters

child IFlexalonNode

The child to insert.

index int

The index to insert the child at.

MarkDirty()

Fully invalidates this node, including its child placements and its parent's placements, and resets transform completion state.

void MarkDirty()

MarkDirtyAdapter()

Marks the adapter's data dirty so it can recheck the node's size.

void MarkDirtyAdapter()

MarkDirtyArrange()

Marks this node as only needing another Arrange call, which is cheaper than a full layout pass.

void MarkDirtyArrange()

MarkDirtyChildren()

Marks this node's child placement inputs as changed and schedules its measurement and arrangement without forcing ancestors to measure or resetting transform state. Delegated nodes forward to their parent. Ancestors update if the measured size changes. ChildrenDirty clears after arrangement.

void MarkDirtyChildren()

MarkDirtyConstrain()

Marks this node as only needing another Constrain call, which is cheaper than a full layout pass.

void MarkDirtyConstrain()

MarkDirtyOffset()

Marks this node as having an offset change, which is cheaper than a full layout pass.

void MarkDirtyOffset()

MarkDirtyPadding()

Marks padding as changed and invalidates child transform positions.

void MarkDirtyPadding()

MarkDirtyRotation()

Marks this node as having a rotation change, which is cheaper than a full layout pass.

void MarkDirtyRotation()

MarkDirtyScale()

Marks this node as having a scale change, which is cheaper than a full layout pass.

void MarkDirtyScale()

MarkDirtySize()

Marks sizing inputs as changed without invalidating child placements or resetting transform completion state. Schedules measurement and the required arrangement.

void MarkDirtySize()

MarkDirtySkipLayout()

Marks this node as having skip layout changed.

void MarkDirtySkipLayout()

MarkDirtyTransformUpdater(TransformFlags)

Asks the transform updater to update the given parts of this node's transform again.

void MarkDirtyTransformUpdater(TransformFlags flags)

Parameters

flags TransformFlags

RemoveModifier(IFlexalonModifier)

Removes a modifier from this node.

void RemoveModifier(IFlexalonModifier modifier)

Parameters

modifier IFlexalonModifier

SetAdapter(IFlexalonAdapter)

Overrides the default adapter for this node.

void SetAdapter(IFlexalonAdapter adapter)

Parameters

adapter IFlexalonAdapter

SetConstraint(IFlexalonConstraint, IFlexalonNode)

Constrains this node to the given target node.

void SetConstraint(IFlexalonConstraint constraint, IFlexalonNode target)

Parameters

constraint IFlexalonConstraint
target IFlexalonNode

SetFlexalonObject(IFlexalonObject)

Assigns a FlexalonObject to this node.

void SetFlexalonObject(IFlexalonObject obj)

Parameters

obj IFlexalonObject

SetMethod(IFlexalonLayout)

Assigns a layout method to this node.

void SetMethod(IFlexalonLayout method)

Parameters

method IFlexalonLayout

SetPositionResult(Vector3)

Set the position result from a layout arrange step. An unchanged result does not invalidate transforms; use MarkDirty to reset externally modified transforms.

void SetPositionResult(Vector3 position)

Parameters

position Vector3

SetRotationResult(Quaternion)

Set the rotation result from a layout arrange step. An unchanged result does not invalidate transforms; use MarkDirty to reset externally modified transforms.

void SetRotationResult(Quaternion quaternion)

Parameters

quaternion Quaternion

SetShrinkFillSize(int, float, float, bool)

Sets the space a child should shrink or fill.

void SetShrinkFillSize(int axis, float childSize, float layoutSize, bool includesSizeOfParent = false)

Parameters

axis int
childSize float
layoutSize float
includesSizeOfParent bool

SetShrinkFillSize(Vector3, Vector3, bool)

Sets the space a child should shrink or fill.

void SetShrinkFillSize(Vector3 childSize, Vector3 layoutSize, bool includesSizeOfParent = false)

Parameters

childSize Vector3
layoutSize Vector3
includesSizeOfParent bool

SetTransformUpdater(IFlexalonTransformUpdater)

Assigns a transform updater to this node.

void SetTransformUpdater(IFlexalonTransformUpdater updater)

Parameters

updater IFlexalonTransformUpdater

SpatialQuery(Bounds, List<IFlexalonNode>)

Adds the direct children whose target bounds intersect or touch the given bounds, in no particular order. Includes virtual children and ignores animation. Children without a layout result aren't included. Doesn't compute layout, so the results are from the last update. Inserted children are omitted until core computes target bounds for their new placement.

void SpatialQuery(Bounds bounds, List<IFlexalonNode> result)

Parameters

bounds Bounds

The bounds to search, in this node's local space.

result List<IFlexalonNode>

The list to add the children to, which isn't cleared first.

Exceptions

InvalidOperationException

EnableSpatialQueries is false.

Events

PreChildrenTransformUpdate

Event invoked after this node's transform is applied and before its children's transforms are applied. Target geometry has already been computed for the entire subtree.

event Action<IFlexalonNode> PreChildrenTransformUpdate

Event Type

Action<IFlexalonNode>

ResultChanged

Event invoked when layout results change.

event Action<IFlexalonNode> ResultChanged

Event Type

Action<IFlexalonNode>