Layout Element Builder
Added: 1.0.0
An interface used to configure and build instances of layout elements.
Use the startLayoutElement() method inside a LayoutConfigScreenBuilder to instantiate a new builder, chain your configuration settings, and finalize the creation by calling build(). Add the resulting LayoutElement to your LayoutConfigScreenBuilder by using addLayoutElementEntry().
Methods
setDefaultValue
Added: 1.0.0
Sets the default layout data of the layout element.
Returns the instance of LayoutElementBuilder.
null by default.
⚠️️ Required for the ability to reset a layout element's value to its default value
setShowName
Added: 1.0.0
Sets whether the element's name should be rendered on the screen.
Returns the instance of LayoutElementBuilder.
true by default.
setNameAlignment
Added: 1.0.0
Sets where the element's name is to be anchored within the element.
Returns the instance of LayoutElementBuilder.
Alignments.create(Alignments.HAlignment.LEFT, Alignments.VAlignment.TOP) by default.
setShowIcon
Added: 1.0.0
Sets whether the element's texture icon should be rendered on the screen.
Returns the instance of LayoutElementBuilder.
true by default.
⚠️️ An icon should be set for it to render
setIcon
Added: 1.0.0
Assigns the specific texture data to be drawn as the element's icon.
Returns the instance of LayoutElementBuilder.
null by default.
setIconAlignment
Added: 1.0.0
Sets where the icon is to be anchored within the element.
Returns the instance of LayoutElementBuilder.
Alignments.create(Alignments.HAlignment.LEFT, Alignments.VAlignment.TOP) by default.
setColor
Added: 1.0.0
Sets the tint of the elements default background and it's buttons.
Returns the instance of LayoutElementBuilder.
Color.create(196, 196, 196) by default.
setDoesDrawBackground
Added: 1.0.0
Sets whether the default background should be drawn behind the element.
Returns the instance of LayoutElementBuilder.
true by default.
setCustomRenderingFunction
Added: 1.0.0
Registers a custom drawing function code to supplement how this layout component renders. Provides the pose stack and layout data as parameters.
Returns the instance of LayoutElementBuilder.
null by default.
setSnapping
Added: 1.0.0
Determines if the element snap to the center of the screen.
Returns the instance of LayoutElementBuilder.
true by default.
setShowButtons
Added: 1.0.0
Sets whether the buttons are to be rendered for the element.
Returns the instance of LayoutElementBuilder.
true by default.
⚠️️ As of version 1.0.0, there is only a Reset button for elements
setButtonsAlignment
Added: 1.0.0
Sets where the element's buttons are to be anchored within the element.
Returns the instance of LayoutElementBuilder.
Alignments.create(Alignments.HAlignment.RIGHT, Alignments.VAlignment.TOP) by default.
setEnableResetButton
Added: 1.0.0
Sets whether the Reset button is to be rendered on screen.
Returns the instance of LayoutElementBuilder.
true by default.
build
Added: 1.0.0
Compiles all the properties into a finalized, fully functional LayoutElement instance and returns it.