Skip to main content

Space

Properties

PropertyTypeDescription
directionhorizontal, verticalDirection of the spacing
sizesmall, middle, large, numberAmount of spacing between elements
aligncenter, start, end, baselineAlignment of elements
wrapbooleanAuto wrap line
blockbooleanWeather to fit width to parent width
[events]functionPlease read the events page

All properties are optional.

Children

Can have children.

Example

local space = myUI:createElement("Space", {
width = "100%",
height = "100%",
}, {
myUI:createElement("Button", {text = "1"}),
myUI:createElement("Button", {text = "2"}),
myUI:createElement("Button", {text = "3"})
})

This is how it looks in-game:

In-Game

Direction

Sets the direction of the spacing.

This is how it looks with vertical direction:

Direction

Size

Sets the size of the spacing between elements.

Size

Align

Sets the alignment of child elements. y-axis.

Start Center End Baseline

Wrap

Auto wraps the child elements within the parent element.

Wrap