SpinBox
An input field for numbers.
SpinBox.swift:30class SpinBox
SpinBox
is a numerical input text field. It allows entering integers and floating-point numbers.
Example:
The above code will create a SpinBox
, disable context menu on it and set the text alignment to right.
Superclasses
class Range
Abstract base class for controls that represent a number within a range.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
A type that can be hashed into a
Hasher
to produce an integer hash value.protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,Rect
,Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
Type members
Instance members
var alignment: HorizontalAlignment
Changes the alignment of the underlying
LineEdit
.var customArrowStep: Double
If not
0
,value
will always be rounded to a multiple ofcustomArrowStep
when interacting with the arrow buttons of theSpinBox
.var editable: Bool
If
true
, theSpinBox
will be editable. Otherwise, it will be read only.var prefix: String
Adds the specified prefix string before the numerical value of the
SpinBox
.var selectAllOnFocus: Bool
If
true
, theSpinBox
will select the whole text when theLineEdit
gains focus. Clicking the up and down arrows won’t trigger this behavior.var suffix: String
Adds the specified suffix string after the numerical value of the
SpinBox
.var updateOnTextChanged: Bool
Sets the value of the
Range
for thisSpinBox
when theLineEdit
text is changed instead of submitted. See [signal LineEdit.text_changed] and [signal LineEdit.text_submitted].func apply(
) Applies the current value of this
SpinBox
.func getLineEdit(
) -> LineEdit? Returns the
LineEdit
instance from thisSpinBox
. You can use it to access properties and methods ofLineEdit
.