UIHorizontalLayout
Places children in a horizontal row with spacing and alignment.
Create in the Editor
- Ensure there is a
UIControllerin the scene. - Create a GameObject and add
UIRect. - Add the
UIHorizontalLayoutcomponent.
How to Use
- Get the component with
myObject.findComponent(UIHorizontalLayout.class). - Read and write the component properties to control behavior.
- Test input or layout in Play mode.
Java Example
SpatialObject myObject = /* your object */;
UIHorizontalLayout comp = myObject.findComponent(UIHorizontalLayout.class);
if (comp != null) {
// set the spacing value:
comp.spacing = 1;
// read the spacing value:
int spacingValue = comp.spacing;
}