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
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
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
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
Method
Returns the layout method of this node.
IFlexalonLayout Method { get; }
Property Value
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
Parent
The parent layout node of this node.
IFlexalonNode Parent { get; }
Property Value
Result
Returns the result of the last layout run.
IFlexalonResult Result { get; }
Property Value
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
childIFlexalonNodeThe child to add.
AddModifier(IFlexalonModifier)
Adds a modifier to this node.
void AddModifier(IFlexalonModifier modifier)
Parameters
modifierIFlexalonModifier
CanShrink(int)
Returns true if this node is not filling this axis and has a min size set.
bool CanShrink(int axis)
Parameters
axisint
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
replacementIFlexalonNodeThe node to exchange with, which may be detached.
indexintThe 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
indexintThe 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
axisintparentSizefloat
Returns
- float
GetMeasureSize(int, float)
Returns the computed size of this node during the measure step.
float GetMeasureSize(int axis, float layoutSize)
Parameters
axisintlayoutSizefloat
Returns
- float
GetMeasureSize(Vector3)
Returns the computed size of this node during the measure step.
Vector3 GetMeasureSize(Vector3 layoutSize)
Parameters
layoutSizeVector3
Returns
- Vector3
GetMinSize(int, float)
Returns the min size of this node, including margin.
float GetMinSize(int axis, float parentSize)
Parameters
axisintparentSizefloat
Returns
- float
GetMinSize(Vector3)
Returns the min size of this node, including margin.
Vector3 GetMinSize(Vector3 parentSize)
Parameters
parentSizeVector3
Returns
- Vector3
GetSizeType(Axis)
Returns the assigned SizeType of this node.
SizeType GetSizeType(Axis axis)
Parameters
axisAxisThe 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
axisintThe 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
scaleVector3includePaddingbool
Returns
- Vector3
GetWorldBoxScale(bool)
Returns the world scale of the layout box. Used for gizmos.
Vector3 GetWorldBoxScale(bool includeLocalScale)
Parameters
includeLocalScalebool
Returns
- Vector3
GetWorldLayoutPosition(Vector3)
Returns the world position of the point this node's layout arranges its children around.
Vector3 GetWorldLayoutPosition(Vector3 scale)
Parameters
scaleVector3
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
childIFlexalonNodeThe child to insert.
indexintThe 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
flagsTransformFlags
RemoveModifier(IFlexalonModifier)
Removes a modifier from this node.
void RemoveModifier(IFlexalonModifier modifier)
Parameters
modifierIFlexalonModifier
SetAdapter(IFlexalonAdapter)
Overrides the default adapter for this node.
void SetAdapter(IFlexalonAdapter adapter)
Parameters
adapterIFlexalonAdapter
SetConstraint(IFlexalonConstraint, IFlexalonNode)
Constrains this node to the given target node.
void SetConstraint(IFlexalonConstraint constraint, IFlexalonNode target)
Parameters
constraintIFlexalonConstrainttargetIFlexalonNode
SetFlexalonObject(IFlexalonObject)
Assigns a FlexalonObject to this node.
void SetFlexalonObject(IFlexalonObject obj)
Parameters
objIFlexalonObject
SetMethod(IFlexalonLayout)
Assigns a layout method to this node.
void SetMethod(IFlexalonLayout method)
Parameters
methodIFlexalonLayout
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
positionVector3
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
quaternionQuaternion
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
axisintchildSizefloatlayoutSizefloatincludesSizeOfParentbool
SetShrinkFillSize(Vector3, Vector3, bool)
Sets the space a child should shrink or fill.
void SetShrinkFillSize(Vector3 childSize, Vector3 layoutSize, bool includesSizeOfParent = false)
Parameters
childSizeVector3layoutSizeVector3includesSizeOfParentbool
SetTransformUpdater(IFlexalonTransformUpdater)
Assigns a transform updater to this node.
void SetTransformUpdater(IFlexalonTransformUpdater updater)
Parameters
updaterIFlexalonTransformUpdater
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
boundsBoundsThe bounds to search, in this node's local space.
resultList<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>