SpinBox¶
Inherits:Range<Control<CanvasItem<Node<Object
Numerical input text field.
Description¶
SpinBox is a numerical input text field. It allows entering integers and floats.
Example:
varspin_box=SpinBox.new()add_child(spin_box)varline_edit=spin_box.get_line_edit()line_edit.context_menu_enabled=falsespin_box.align=LineEdit.ALIGN_RIGHT
The above code will create aSpinBox, disable context menu on it and set the text alignment to right.
SeeRange class for more options over theSpinBox.
Note:SpinBox relies on an underlyingLineEdit node. To theme aSpinBox's background, add theme items forLineEdit and customize them.
Properties¶
| ||
| ||
| ||
|
Methods¶
void | apply() |
Theme Properties¶
Property Descriptions¶
Alignalign
Default |
|
Setter | set_align(value) |
Getter | get_align() |
Sets the text alignment of theSpinBox.
booleditable
Default |
|
Setter | set_editable(value) |
Getter | is_editable() |
Iftrue, theSpinBox will be editable. Otherwise, it will be read only.
Stringprefix
Default |
|
Setter | set_prefix(value) |
Getter | get_prefix() |
Adds the specifiedprefix string before the numerical value of theSpinBox.
Stringsuffix
Default |
|
Setter | set_suffix(value) |
Getter | get_suffix() |
Adds the specifiedsuffix string after the numerical value of theSpinBox.
Method Descriptions¶
voidapply()
Applies the current value of thisSpinBox.
LineEditget_line_edit()
Returns theLineEdit instance from thisSpinBox. You can use it to access properties and methods ofLineEdit.
Warning: This is a required internal node, removing and freeing it may cause a crash. If you wish to hide it or any of its children, use theirCanvasItem.visible property.
Theme Property Descriptions¶
Textureupdown
Sets a customTexture for up and down arrows of theSpinBox.