TextFieldWidget
The TextFieldWidget
provides an editable text field for GUI interfaces. It supports dynamic text updates via a supplier and responder, validation through custom validators, and configurable properties such as maximum string length, border style, and text color.
Basic Properties
Field | Description |
---|---|
currentString | The current text displayed by the text field |
maxStringLength | Maximum allowed length for the text |
isBordered | Determines whether the text field has a border |
textColor | The color of the text (modifiable via setter) |
supplier | A supplier for dynamic text updates |
textResponder | A responder that handles text changes |
wheelDur | Duration (or step value) used for mouse wheel adjustments |
APIs
setTextSupplier
Sets the supplier used to update the text dynamically.
setTextResponder
Sets the responder to be called when the text changes.
setBordered
Configures whether the text field should display a border.
setTextColor
Sets the text color for the text field.
setMaxStringLength
Sets the maximum number of characters allowed in the text field.
setValidator
Assigns a custom validator function to control and sanitize text input.
setCompoundTagOnly
Restricts input to valid compound tags. Displays a tooltip indicating the restriction.
setResourceLocationOnly
Restricts input to valid resource locations. Displays a tooltip indicating the restriction.
setNumbersOnly
Restricts input to numeric values. Overloads are available for different numeric types.
setWheelDur
Sets the wheel duration (step value) for adjusting numbers via mouse wheel or dragging.