Documentation
¶
Overview ¶
Range is an abstract base class for controls that represent a number within a range, using a configured Step and Page size. See e.g. ScrollBar and Slider for examples of higher-level nodes using Range.
Index ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Implementation
- type Instance
- func (self Instance) AllowGreater() bool
- func (self Instance) AllowLesser() bool
- func (self Instance) AsCanvasItem() CanvasItem.Instance
- func (self Instance) AsControl() Control.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRange() Instance
- func (self Instance) ExpEdit() bool
- func (self Instance) ID() ID
- func (self Instance) MaxValue() Float.X
- func (self Instance) MinValue() Float.X
- func (self Instance) OnChanged(cb func(), flags ...Signal.Flags)
- func (self Instance) OnValueChanged(cb func(value Float.X), flags ...Signal.Flags)
- func (self Instance) Page() Float.X
- func (self Instance) Ratio() Float.X
- func (self Instance) Rounded() bool
- func (self Instance) SetAllowGreater(value bool)
- func (self Instance) SetAllowLesser(value bool)
- func (self Instance) SetExpEdit(value bool)
- func (self Instance) SetMaxValue(value Float.X)
- func (self Instance) SetMinValue(value Float.X)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetPage(value Float.X)
- func (self Instance) SetRatio(value Float.X)
- func (self Instance) SetRounded(value bool)
- func (self Instance) SetStep(value Float.X)
- func (self Instance) SetValue(value Float.X)
- func (self Instance) SetValueNoSignal(value Float.X)
- func (self Instance) Share(with Node.Instance)
- func (self Instance) Step() Float.X
- func (self Instance) Unshare()
- func (self Instance) Value() Float.X
- func (self Instance) Virtual(name string) reflect.Value
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this [Extension]See Interface for methods that can be overridden by T.
func (*Extension[T]) AsCanvasItem ¶
func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Implementation ¶
type Implementation = implementation
Implementation implements Interface with empty methods.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AllowGreater ¶
func (Instance) AllowLesser ¶
func (Instance) AsCanvasItem ¶
func (self Instance) AsCanvasItem() CanvasItem.Instance
func (Instance) ExpEdit ¶
If true, and MinValue is greater or equal to 0, Value will be represented exponentially rather than linearly.
func (Instance) OnValueChanged ¶
Emitted when Value changes. When used on a Slider, this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to OnValueChanged, consider using a debouncing Timer to call the function less often.
Note: Unlike signals such as OnLineedit.TextChanged, OnValueChanged is also emitted when 'value' is set directly via code.
func (Instance) Page ¶
Page size. Used mainly for ScrollBar. A ScrollBar's grabber length is the ScrollBar's size multiplied by Page over the difference between MinValue and MaxValue.
func (Instance) SetAllowGreater ¶
SetAllowGreater sets the property returned by [IsGreaterAllowed].
func (Instance) SetAllowLesser ¶
SetAllowLesser sets the property returned by [IsLesserAllowed].
func (Instance) SetExpEdit ¶
SetExpEdit sets the property returned by [IsRatioExp].
func (Instance) SetMaxValue ¶
SetMaxValue sets the property returned by [GetMax].
func (Instance) SetMinValue ¶
SetMinValue sets the property returned by [GetMin].
func (Instance) SetRounded ¶
SetRounded sets the property returned by [IsUsingRoundedValues].
func (Instance) SetValueNoSignal ¶
Sets the Range's current value to the specified 'value', without emitting the OnValueChanged signal.
func (Instance) Share ¶
Binds two Ranges together along with any ranges previously grouped with either of them. When any of range's member variables change, it will share the new value with all other ranges in its group.
func (Instance) Step ¶
If greater than 0, Value will always be rounded to a multiple of this property's value above MinValue. For example, if MinValue is 0.1 and step is 0.2, then Value is limited to 0.1, 0.3, 0.5, and so on. If Rounded is also true, Value will first be rounded to a multiple of this property's value, then rounded to the nearest integer.
func (Instance) Unshare ¶
func (self Instance) Unshare()
Stops the Range from sharing its member variables with any other.
func (Instance) Value ¶
Range's current value. Changing this property (even via code) will trigger OnValueChanged signal. Use SetValueNoSignal if you want to avoid it.
type Interface ¶
type Interface interface { // Called when the [Range]'s value is changed (following the same conditions as [OnValueChanged]). // // [OnValueChanged]: https://pkg.go.dev/graphics.gd/classdb/Range#Instance.OnValueChanged // [Range]: https://pkg.go.dev/graphics.gd/classdb/Range ValueChanged(new_value Float.X) }