SpinBox

Refreshing Cache...

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:

var spin_box = SpinBox.new()
add_child(spin_box)
var line_edit = spin_box.get_line_edit()
line_edit.context_menu_enabled = false
spin_box.align = LineEdit.ALIGN_RIGHT

The above code will create a SpinBox, disable context menu on it and set the text alignment to right.

See Range class for more options over the SpinBox.

Methods

voidapply ( )
LineEditget_line_edit ( )

Theme Properties

Textureupdown

Property Descriptions

Default0
Setterset_align(value)
Getterget_align()

Sets the text alignment of the SpinBox.


Defaulttrue
Setterset_editable(value)
Getteris_editable()

If true, the SpinBox will be editable. Otherwise, it will be read only.


Default""
Setterset_prefix(value)
Getterget_prefix()

Adds the specified prefix string before the numerical value of the SpinBox.


Default""
Setterset_suffix(value)
Getterget_suffix()

Adds the specified prefix string after the numerical value of the SpinBox.

Method Descriptions

  • void apply ( )

Applies the current value of this SpinBox.


Returns the LineEdit instance from this SpinBox. You can use it to access properties and methods of LineEdit.

doradoro's advice! Getters and Setters will be deprecated! Avoid their use!

Disclaimer: This page has been automaticaly and directly extracted from the official Godot Docs website, the 2020-03-07 at 01:39:48. It's the English Stable version because it's what most Godot users should use. The Copyright owners are Juan Linietsky, Ariel Manzur and the Godot community. CC-BY 3.0. Thanks for your patience and generosity.