Skip to main content

UIHorizontalLayout

Places children in a horizontal row with spacing and alignment.

Create in the Editor​

  1. Ensure there is a UIController in the scene.
  2. Create a GameObject and add UIRect.
  3. Add the UIHorizontalLayout component.

How to Use​

  1. Get the component with myObject.findComponent(UIHorizontalLayout.class).
  2. Read and write the component properties to control behavior.
  3. 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;

}