Cells and Rows

Flexalon Cell controls where a child appears in a Grid or Table. Add it when an item needs a specific location, spans multiple cells, or overlaps another item. Coordinates are zero-based and use column, row, layer order.

Placement and spans

OptionBehavior
Specify PlacementStart placement at the chosen Column, Row, and Layer. Without overlap, occupied cells are skipped and spans can wrap at the column boundary.
Column / Row / Layer SpanHow many cells the item occupies on each axis. Automatic placement searches for room for the entire span.
Overlap CellsAllow specified placement over occupied cells and leave this item's cells available to following children, such as a badge or highlight on top of another item. Automatic placement still searches for free space.
Capture Current CellSave the item's current automatic placement and enable Specify Placement. Useful when inventory items should stay put as other items move.

For example, set Column Span to 2 for a wide inventory item. Leave Specify Placement off to find room automatically, or enable it to start searching at a particular cell.

Existing Flexalon Grid Cell components still work. Use Flexalon Cell for new objects. Disabling a cell component removes its placement settings until it is enabled again.

Group a row

Use Flexalon Row to keep a set of items together in their own row, while still lining up with the table's columns. For example, in a scoreboard each player can be one GameObject with name, score, and avatar children.

  1. Add a child GameObject to your Table or Grid and add Flexalon Row to it.
  2. Add the row's items as children of that GameObject. They fill the row's cells in order, just as they would in the table.
  3. To place an item in a specific cell of the row, add a Flexalon Cell to the item. Its Row and Layer count from the start of the group, so Row 0 is the group's first row.

A group always spans every column. If its items need more than one row, the group grows to fit them. To choose which row the group starts on, add a Flexalon Cell to the group itself; its column and span settings are ignored. Padding and margins on the group are also ignored.

Find cells in code

Grid and Table layouts can tell you which cell is under a point. Use TryGetCellAtWorldPoint with a world-space position, such as a raycast hit. To find which items occupy a set of cells, use GetChildrenInSpan. Results reflect the most recent layout update.

For interactive placement and swapping, see slot-based drag and drop.

Cell API · Row API · Cell lookup API