1.3 KiB
1.3 KiB
Checkbox : VisualElement
The Checkbox is a visual element that can be checked.
Properties
| Property | Type | Default | Description |
|---|---|---|---|
| checked | boolean | Whether | checkbox is checked |
| text | string | empty | Text to display |
| checkedText | string | Text | when checked |
| autoSize | boolean | true | Whether to automatically size the checkbox |
Functions
| Method | Returns | Description |
|---|---|---|
| Checkbox.new | Checkbox | Creates a new Checkbox instance |
| Checkbox:init | - | Initializes the Checkbox instance |
| Checkbox:mouse_click | boolean | Handles mouse click events |
| Checkbox:render | - | Renders the Checkbox |
Checkbox.new()
Creates a new Checkbox instance
Returns
CheckboxselfThe created instance
Checkbox:init(props, basalt)
Initializes the Checkbox instance
Parameters
propstableThe properties to initialize the element withbasalttableThe basalt instance
Checkbox:mouse_click(button, x, y)
Handles mouse click events
Parameters
buttonnumberThe button that was clickedxnumberThe x position of the clickynumberThe y position of the click
Returns
booleanClickedWhether the event was handled
Checkbox:render()
Renders the Checkbox