SpinBox

Inherits: Range < Control < CanvasItem < Node < Object

Category: Core

Brief Description

Numerical input text field.

Properties

Alignalign
booleditable
Stringprefix
Stringsuffix

Methods

LineEditget_line_edit ( )

Theme Properties

Textureupdown

Description

SpinBox is a numerical input text field. It allows entering integers and floats.

Example:

  1. var spin_box = SpinBox.new()
  2. add_child(spin_box)
  3. var line_edit = spin_box.get_line_edit()
  4. line_edit.context_menu_enabled = false
  5. 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.

Property Descriptions

Setterset_align(value)
Getterget_align()

Sets the text alignment of the SpinBox.


Setterset_editable(value)
Getteris_editable()

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


Setterset_prefix(value)
Getterget_prefix()

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


Setterset_suffix(value)
Getterget_suffix()

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

Method Descriptions

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