Creating a Layout Element
You can easily create and add layout elements to your layout config screen using the layout element builder.
Initialize the Builder
Instantiate a new LayoutElementBuilder by calling the startLayoutElement() method.
You must pass your persistent AlignmentSizeOffset object as the value, and a name for the element as parameters.
| java | |
|---|---|
You can then chain methods together to define the element's properties.
For example
| java | |
|---|---|
- Default Value: The default
AlignmentSizeOffsetvalue used if a player hits the reset button on the config UI. - Show Name: A boolean setting that toggles whether a text label renders for this element on the config screen.
Building and Registering the Element
Build the layout element using LayoutElementBuilder.build() and register it to your LayoutConfigScreenBuilder instance by passing it into the addLayoutElementEntry() method.
| java | |
|---|---|
You can learn more about LayoutElementBuilder at LayoutElementBuilder API Reference Page