Table of Contents

Class FlexalonTableLayout

Namespace
Flexalon
Assembly
Flexalon.dll

Use a table layout to position children in rows, columns, and layers. Rows, columns, and layers can have different sizing behavior.

[AddComponentMenu("Flexalon/Flexalon Table Layout")]
[HelpURL("https://www.flexalon.com/docs/tableLayout")]
public class FlexalonTableLayout : FlexalonCellLayout, IFlexalonLayout, IFlexalonSlottedLayout
Inheritance
object
Object
Component
Behaviour
MonoBehaviour
FlexalonTableLayout
Implements
Inherited Members

Properties

Columns

Column count, defaults, and per-column overrides.

public FlexalonTableLayout.TrackCollection Columns { get; }

Property Value

FlexalonTableLayout.TrackCollection

Layers

Layer count, defaults, and per-layer overrides.

public FlexalonTableLayout.TrackCollection Layers { get; }

Property Value

FlexalonTableLayout.TrackCollection

MinCellCount

protected override Vector3Int MinCellCount { get; }

Property Value

Vector3Int

Rows

Row count, defaults, and per-row overrides.

public FlexalonTableLayout.TrackCollection Rows { get; }

Property Value

FlexalonTableLayout.TrackCollection

Methods

Arrange(IFlexalonNode, Vector3)

Position the children of node within the available bounds.

public override void Arrange(IFlexalonNode node, Vector3 layoutSize)

Parameters

node IFlexalonNode
layoutSize Vector3

DoOnEnable()

Called when the component is enabled.

protected override void DoOnEnable()

GetCellBounds(Vector3Int, Vector3Int, bool)

protected override Bounds GetCellBounds(Vector3Int cell, Vector3Int span, bool gridEdges = false)

Parameters

cell Vector3Int
span Vector3Int
gridEdges bool

Returns

Bounds

GetLayoutOffset()

protected override Vector3 GetLayoutOffset()

Returns

Vector3

Initialize()

Called when the component is first created.

protected override void Initialize()

Measure(IFlexalonNode, Vector3, Vector3, Vector3)

Perform minimal work to determine what the size of node and available size for node's children.

public override Bounds Measure(IFlexalonNode node, Vector3 size, Vector3 min, Vector3 max)

Parameters

node IFlexalonNode
size Vector3
min Vector3
max Vector3

Returns

Bounds

TryGetCellAtLocalPoint(Vector3, out Vector3Int)

Finds the cell containing a point in the same layout space as TryGetCellBounds. Gaps belong to the nearest track; shared boundaries choose the lower track index.

public override bool TryGetCellAtLocalPoint(Vector3 localPoint, out Vector3Int cell)

Parameters

localPoint Vector3

A point relative to the layout center, before transform scale and rotation.

cell Vector3Int

The column, row, and layer containing the point.

Returns

bool

True if the point is inside the solved grid, including its depth.

Upgrade(int)

Called when the component is upgraded to a new version of Flexalon.

protected override void Upgrade(int fromVersion)

Parameters

fromVersion int