Signal1
Signal support.
Range.swift:747class Signal1
Use the connect(flags:_:)
method to connect to the signal on the container object, and disconnect(_:)
to drop the connection.
You can also await the emitted
property for waiting for a single emission of the signal.
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (17) members.
Type members
Instance members
var allowGreater: Bool
var allowLesser: Bool
var changed: SimpleSignal
var expEdit: Bool
If
true
, andminValue
is greater than 0,value
will be represented exponentially rather than linearly.var maxValue: Double
Maximum value. Range is clamped if
value
is greater thanmaxValue
.var minValue: Double
Minimum value. Range is clamped if
value
is less thanminValue
.var page: Double
Page size. Used mainly for
ScrollBar
. ScrollBar’s length is its size multiplied bypage
over the difference betweenminValue
andmaxValue
.var ratio: Double
The value mapped between 0 and 1.
var rounded: Bool
If
true
,value
will always be rounded to the nearest integer.var step: Double
If greater than 0,
value
will always be rounded to a multiple of this property’s value. Ifrounded
is alsotrue
,value
will first be rounded to a multiple of this property’s value, then rounded to the nearest integer.var value: Double
Range’s current value. Changing this property (even via code) will trigger [signal value_changed] signal. Use
setValueNoSignal(value:)
if you want to avoid it.var valueChanged: Signal1
Emitted when
value
changes. When used on aSlider
, this is called continuously while dragging (potentially every frame). If you are performing an expensive operation in a function connected to [signal value_changed], consider using a debouncingTimer
to call the function less often.func setValueNoSignal(value: Double
) Sets the
Range
’s current value to the specifiedvalue
, without emitting the [signal value_changed] signal.
Show implementation details (1)
Hide implementation details
func _valueChanged(newValue: Double
) Called when the
Range
’s value is changed (following the same conditions as [signal value_changed]).
Citizens in SwiftGodot
Instance members
var emitted: Void
You can await this property to wait for the signal to be emitted once
func connect(flags: Object.ConnectFlags, @escaping (_ value: Double) -> ()
) -> Object Connects the signal to the specified callback
func disconnect(Object
) Disconnects a signal that was previously connected, the return value from calling
connect(flags:_:)