Table of Contents


Extends: Group 

Description

The LayoutGroup node class manages the position of its child nodes by arranging them in a row from left to right (horizontal layout), or in a column from top to bottom (vertical layout). Fields provide options to control the spacing between children, the horizontal and vertical alignment, and the margins around the edges of the group.

Fields

FieldTypeDefaultUse
layoutDirectionstring"vert"

Controls the layout direction.

ValueUse
horizPositions the children in a row from left to right
vertPositions the children in a column from top to bottom
horizAlignmentstring"left"

Specifies the alignment point in the horizontal direction. The effect of the value set depends on the whether the layoutDirection field value is set to either horiz or vert.

ValuelayoutDirection Use
left vertAligns the left edges of each child in the column, and sets the LayoutGroup node local x-coordinate origin at the left edge of the children
horizSets the LayoutGroup node local x-coordinate origin at the left edge of the first child
center vertAligns the centers of each child in the column, and sets the LayoutGroup node local x-coordinate origin at the center alignment point
horizSets the LayoutGroup node local x-coordinate origin at the center of the horizontal row of children
right vertAligns the right edges of each child in the column, and sets the LayoutGroup node local x-coordinate origin is at the right edge of the children
horizSets the LayoutGroup node local x-coordinate origin at the right edge of the last child
customvert

Explicitly set the x translation of each child of the LayoutGroup. If the layoutDirection is "horiz", custom will not be a valid setting. Instead, "left" will be used to do the child layout.

Available since firmware version 7.5

vertAlignmentstring"top"

Specifies the alignment point in the vertical direction. The effect of the value set depends on the whether the layoutDirection field value is set to either horiz or vert.

ValuelayoutDirection Use
top horizAligns the top edges of each child in the row, and sets the LayoutGroup node local y-coordinate origin at the top edge of the children
vertSets the LayoutGroup node local y-coordinate origin at the top edge of the first child
center horizAligns the centers of each child in the row, and sets the LayoutGroup node local y-coordinate origin at the center alignment point
vertSets the LayoutGroup node local y-coordinate origin at the center of the vertical column of children
bottom horizAligns the bottom edges of each child in the row, and sets the LayoutGroup node local y-coordinate origin at the bottom edge of the children
vertSets the LayoutGroup node local y-coordinate origin at the bottom edge of the last child
customhoriz

Explicitly set the y translation of each child of the LayoutGroup. If the layoutDirection is "vert", custom will not be a valid setting. Instead, "top" will be used to do the child layout.

Available since firmware version 7.5

itemSpacingsarray of floats[ ]

Controls the spacing before or after each child in the layout direction. By default, no space is added between the children.

If the field value array is set with a single value, and the addItemSpacingAfterChild field value is set to true, that amount of space is inserted after each child is positioned. If the addItemSpacingAfterChild field value is set to false, the space is inserted before each child is positioned.

If the field value array has more than one value, the first value specifies the spacing before or after the first item, the second value specifies the spacing before or after the second item, and so on. If there are fewer values in the field value array than needed, the final value is repeated as needed. If there are more values in the field value array than needed, the extra values are ignored.

addItemSpacingAfterChildBooleantrue

Controls how the spaces specified in the itemSpacings field are inserted. By default, the field value is set to true. This causes the specified spaces to be inserted after the child is positioned. If the field value is set to false, the specified item space is inserted before the child is positioned.