TweenPauseMode
Tween.swift:69enum TweenPauseModeenum TweenPauseModeimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class TweenLightweight object used for general-purpose animation via script, using Tweeners.
case boundIf the Tween has a bound node, it will process when that node can process (see processMode). Otherwise it’s the same as .tweenPauseStop.
case stopIf SceneTree is paused, the Tween will also pause.
case processThe Tween will process regardless of whether SceneTree is paused.
static func interpolateValue(initialValue: Variant, deltaValue: Variant, elapsedTime: Double, duration: Double, transType: Tween.TransitionType, easeType: Tween.EaseType) -> Variant This method can be used for manual interpolation of a value, when you don’t want Tween to do animating for you. It’s similar to @GlobalScope.lerp, but with support for custom transition and easing.
override class var godotClassName: StringName { get }var finished: SimpleSignal { get }Emitted when the Tween has finished all tweening. Never emitted when the Tween is set to infinite looping (see setLoops(_:)).
var loopFinished: Signal2 { get }Emitted when a full loop is complete (see setLoops(_:)), providing the loop index. This signal is not emitted after the final loop, use [signal finished] instead for this case.
var stepFinished: Signal1 { get }Emitted when one step of the Tween is complete, providing the step index. One step is either a single Tweener or a group of Tweeners running in parallel.
final func bindNode(_ node: Node?) -> Tween? Binds this Tween with the given node. Tweens are processed directly by the SceneTree, so they run independently of the animated nodes. When you bind a Node with the Tween, the Tween will halt the animation when the object is not inside tree and the Tween will be automatically killed when the bound object is freed. Also .tweenPauseBound will make the pausing behavior dependent on the bound node.
final func chain() -> Tween? Used to chain two Tweeners after setParallel(_:) is called with true.
final func customStep(delta: Double) -> Bool Processes the Tween by the given delta value, in seconds. This is mostly useful for manual control when the Tween is paused. It can also be used to end the Tween animation immediately, by setting delta longer than the whole duration of the Tween animation.
final func getLoopsLeft() -> Int32 Returns the number of remaining loops for this Tween (see setLoops(_:)). A return value of -1 indicates an infinitely looping Tween, and a return value of 0 indicates that the Tween has already finished.
final func getTotalElapsedTime() -> Double Returns the total time in seconds the Tween has been animating (i.e. the time since it started, not counting pauses etc.). The time is affected by setSpeedScale(speed:), and stop will reset it to 0.
final func isRunning() -> Bool Returns whether the Tween is currently running, i.e. it wasn’t paused and it’s not finished.
final func isValid() -> Bool Returns whether the Tween is valid. A valid Tween is a Tween contained by the scene tree (i.e. the array from getProcessedTweens will contain this Tween). A Tween might become invalid when it has finished tweening, is killed, or when created with Tween.new(). Invalid Tweens can’t have Tweeners appended.
final func kill() Aborts all tweening operations and invalidates the Tween.
final func parallel() -> Tween? Makes the next Tweener run parallelly to the previous one.
final func pause() Pauses the tweening. The animation can be resumed by using play.
final func play() Resumes a paused or stopped Tween.
final func setEase(_ ease: Tween.EaseType) -> Tween? Sets the default ease type for PropertyTweeners and MethodTweeners animated by this Tween.
final func setLoops(_ loops: Int32 = 0) -> Tween? Sets the number of times the tweening sequence will be repeated, i.e. set_loops(2) will run the animation twice.
final func setParallel(_ parallel: Bool = true) -> Tween? If parallel is true, the Tweeners appended after this method will by default run simultaneously, as opposed to sequentially.
final func setPauseMode(_ mode: Tween.TweenPauseMode) -> Tween? Determines the behavior of the Tween when the SceneTree is paused. Check TweenPauseMode for options.
final func setProcessMode(_ mode: Tween.TweenProcessMode) -> Tween? Determines whether the Tween should run after process frames (see _process(delta:)) or physics frames (see _physicsProcess(delta:)).
final func setSpeedScale(speed: Double) -> Tween? Scales the speed of tweening. This affects all Tweeners and their delays.
final func setTrans(_ trans: Tween.TransitionType) -> Tween? Sets the default transition type for PropertyTweeners and MethodTweeners animated by this Tween.
final func stop() Stops the tweening and resets the Tween to its initial state. This will not remove any appended Tweeners.
final func tweenCallback(_ callback: Callable) -> CallbackTweener? Creates and appends a CallbackTweener. This method can be used to call an arbitrary method in any object. Use Callable/bind() to bind additional arguments for the call.
final func tweenInterval(time: Double) -> IntervalTweener? Creates and appends an IntervalTweener. This method can be used to create delays in the tween animation, as an alternative to using the delay in other Tweeners, or when there’s no animation (in which case the Tween acts as a timer). time is the length of the interval, in seconds.
final func tweenMethod(_ method: Callable, from: Variant, to: Variant, duration: Double) -> MethodTweener? Creates and appends a MethodTweener. This method is similar to a combination of tweenCallback(_:) and tweenProperty(object:property:finalVal:duration:). It calls a method over time with a tweened value provided as an argument. The value is tweened between from and to over the time specified by duration, in seconds. Use Callable/bind() to bind additional arguments for the call. You can use setEase(_:) and setTrans(_:) to tweak the easing and transition of the value or setDelay(_:) to delay the tweening.
final func tweenProperty(object: Object?, property: NodePath, finalVal: Variant, duration: Double) -> PropertyTweener? Creates and appends a PropertyTweener. This method tweens a property of an object between an initial value and finalVal in a span of time equal to duration, in seconds. The initial value by default is the property’s value at the time the tweening of the PropertyTweener starts.
enum EaseTypeclass Signal1Signal support.
class Signal2Signal support.
enum TransitionTypeenum TweenProcessModeprotocol CaseIterableA type that provides a collection of all of its values.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol Hashable : EquatableA type that can be hashed into a Hasher to produce an integer hash value.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
init?(rawValue: Int64) var debugDescription: String { get }A textual representation of this instance, suitable for debugging
var hashValue: Int { get }static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func hash(into hasher: inout Hasher)