Builder

class Builder(message: Text, onPress: Consumer<CustomButtonWidget>)

Builds a CustomButtonWidget

Author

fzzyhmstrs

Since

0.5.?

Parameters

message

Text the button label

onPress

Consumer<CustomButtonWidget> action to invoke when the button is clicked or activated

Constructors

Link copied to clipboard
constructor(message: Text, onPress: Consumer<CustomButtonWidget>)

Functions

Link copied to clipboard

Sets the active state of this button.

Link copied to clipboard
Link copied to clipboard

Applies a TooltipChild to this button for passing additional tooltip info

Link copied to clipboard
fun dimensions(x: Int, y: Int, width: Int, height: Int): CustomButtonWidget.Builder

Sets the XY position and width/height of this widget. Defaults are position 0, 0 and 150w x 20h

Link copied to clipboard

Sets the height of this widget. Default value is 20

Link copied to clipboard
fun narrationAppender(narrationAppender: Consumer<NarrationMessageBuilder>): CustomButtonWidget.Builder

Applies a narration appender to this widget for adding narrations on top of the standard button narrations. Default is none.

Link copied to clipboard
fun narrationSupplier(narrationSupplier: ButtonWidget.NarrationSupplier): CustomButtonWidget.Builder

Applies a narration supplier to this widget. Default is the standard supplier for buttons, which narrates the button as "Message button"

Link copied to clipboard

Disables rendering of the label provided to the button

Link copied to clipboard

Positions the widget in both x and y. Default is 0, 0

Link copied to clipboard
fun size(width: Int, height: Int): CustomButtonWidget.Builder

Sets the width and height of this widget. Default is 150w x 20h

Link copied to clipboard
fun texture(tex: Identifier): CustomButtonWidget.Builder

Defines the texture for rendering the button background. The sprite rendered will not change based on object state.

Link copied to clipboard
fun textures(tex: Identifier, disabled: Identifier, highlighted: Identifier): CustomButtonWidget.Builder

Defines the texture set used for rendering the button background

Link copied to clipboard
fun tooltip(tooltip: Tooltip?): CustomButtonWidget.Builder

Applies a Tooltip to this widget. Default is null

Link copied to clipboard

Sets the width of this widget. Default value is 150