CustomButtonWidget

constructor(x: Int, y: Int, width: Int, height: Int, message: Text, pressAction: Consumer<CustomButtonWidget>, narrationSupplier: CustomButtonWidget.ActiveNarrationSupplier = DEFAULT_ACTIVE_NARRATION_SUPPLIER, narrationAppender: Consumer<NarrationMessageBuilder> = Consumer { _-> }, textures: TextureSet = DEFAULT_TEXTURES, child: TooltipChild? = null, renderMessage: Boolean = true)

Deprecated

Custom button widgets now use TextureProvider. Use the primary constructor. Scheduled for removal 0.7.0

A custom ButtonWidget implementation with builder and rendering improvements (and more features in general)

This constructor is for compatibility purposes with subclasses. Use the builder to create buttons.

Author

fzzyhmstrs

Since

0.6.4, scheduled for removal 0.7.0

Parameters

x

button X position

y

button Y position

width

button width in pixels

height

button height in pixels

pressAction

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

narrationSupplier

ButtonWidget.NarrationSupplier same use as in vanilla; converts a provided input text into a narration text.

narrationAppender

Consumer<NarrationMessageBuilder> unlike the supplier, this is used to directly append additional narrations as needed to the message builder.

child

TooltipChild, used to pass additional tooltip context. This button will pass and tooltip from this child out to its own parent (this button is also a TooltipChild)

textures

TextureSet, default CustomPressableWidget.DEFAULT_TEXTURES. The textures for this button

renderMessage

If false, the label won't be rendered