-
Notifications
You must be signed in to change notification settings - Fork 0
Tween
Home | API by Category | Complete API Index | API Compatibility
| Field | Value |
|---|---|
| Full name | Electron2D.Tween |
| Namespace | Electron2D |
| Kind | class |
| Category | Animation and Tweening |
Runs sequential property, interval and callback animation steps.
public class Electron2D.Tween : Electron2D.RefCountedProfile: Electron2D 0.1.0 2D
Status: Partial / Not verified
Out of profile: yes
Godot reference: Tween
Sequential runtime tween with property, interval and callback steps, easing, pause/play/stop, kill, manual stepping and completion signals.
Create runtime tweens with Electron2D.SceneTree.CreateTween or
Electron2D.Node.CreateTween. A manually constructed tween is useful only
as an invalid value for API parity checks and cannot receive tweeners.
Electron2D 0.1.0 Preview processes tweens after node process callbacks and before draw callbacks. This baseline supports sequential tweeners, easing, pause/resume, stop, cancellation and completion signals.
This type is not synchronized. Create and mutate tweens on the main scene thread that owns the scene tree.
This type is available since Electron2D 0.1.0 Preview.
Electron2D.Node.CreateTweenElectron2D.SceneTree.CreateTweenElectron2D.Tweener
| Member | Kind | Summary |
|---|---|---|
Electron2D.Tween() |
Constructor | Creates an invalid standalone tween. |
BindNode(Electron2D.Node) |
Method | Binds this tween to a node lifetime. |
CustomStep(System.Double) |
Method | Manually advances this tween by a delta time. |
GetTotalElapsedTime() |
Method | Gets the accumulated processed time for this tween. |
HasTweeners() |
Method | Checks whether this tween has any tweeners. |
InterpolateValue(Electron2D.Variant, Electron2D.Variant, System.Double, System.Double, Electron2D.Tween.TransitionType, Electron2D.Tween.EaseType) |
Method | Computes an eased interpolated value from an initial value and delta. |
IsRunning() |
Method | Checks whether this tween is currently advancing automatically. |
IsValid() |
Method | Checks whether this tween is registered and can accept tweeners. |
Kill() |
Method | Cancels this tween and removes it from scene tree processing. |
Pause() |
Method | Pauses automatic processing for this tween. |
Play() |
Method | Starts or resumes automatic processing for this tween. |
SetEase(Electron2D.Tween.EaseType) |
Method | Sets the default ease mode for subsequently added property tweeners. |
SetSpeedScale(System.Double) |
Method | Sets the speed multiplier used by future tween processing steps. |
SetTrans(Electron2D.Tween.TransitionType) |
Method | Sets the default transition for subsequently added property tweeners. |
Stop() |
Method | Stops this tween and rewinds its sequence time. |
TweenCallback(Electron2D.Callable) |
Method | Adds a callback tweener to this tween. |
TweenInterval(System.Double) |
Method | Adds a time-only interval to this tween. |
TweenProperty(Electron2D.Object, Electron2D.NodePath, Electron2D.Variant, System.Double) |
Method | Adds a property tweener to this tween. |
Kind: Constructor
public Electron2D.Tween()Creates an invalid standalone tween.
Standalone tweens are not registered in a scene tree and cannot receive
tweeners. Use Electron2D.SceneTree.CreateTween or
Electron2D.Node.CreateTween for runtime animation.
The constructor registers the finished and
step_finished signals so callers can inspect signal availability
even before the tween is registered.
Construction is safe on any thread when the instance is not shared until construction completes.
This constructor is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.IsValid
Kind: Method
public Electron2D.Tween BindNode(Electron2D.Node)(Electron2D.Node node)Binds this tween to a node lifetime.
A bound tween advances automatically only while the node is valid and
inside a scene tree. The tween remains valid while the node is detached,
but Electron2D.Tween.IsRunning returns false until the node is valid
again.
-
node: The node that controls automatic tween processing.
This tween instance.
-
System.ArgumentNullException: Thrown whennodeisnull. -
System.InvalidOperationException: Thrown when this tween is not registered in a scene tree.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Node.CreateTween
Kind: Method
public System.Boolean CustomStep(System.Double)(System.Double delta)Manually advances this tween by a delta time.
Manual stepping works while the tween is paused. It still respects bound node validity and does not advance a tween whose bound node is outside the scene tree.
-
delta: The finite non-negative delta time in seconds.
true when the tween is still valid after the step; otherwise,
false.
-
System.ArgumentOutOfRangeException: Thrown whendeltais negative or not finite.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween
Kind: Method
public System.Double GetTotalElapsedTime()()Gets the accumulated processed time for this tween.
The value is reset by Electron2D.Tween.Stop and stops increasing while the
tween is paused unless Electron2D.Tween.CustomStep(System.Double) is called.
The total elapsed time in seconds after speed scaling has been applied.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween
Kind: Method
public System.Boolean HasTweeners()()Checks whether this tween has any tweeners.
This method follows the validation and lifetime rules of its declaring type.
true when this tween is valid and contains at least one tweener;
otherwise, false.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween
InterpolateValue(Electron2D.Variant, Electron2D.Variant, System.Double, System.Double, Electron2D.Tween.TransitionType, Electron2D.Tween.EaseType)
Kind: Method
public static Electron2D.Variant InterpolateValue(Electron2D.Variant, Electron2D.Variant, System.Double, System.Double, Electron2D.Tween.TransitionType, Electron2D.Tween.EaseType)(Electron2D.Variant initialValue, Electron2D.Variant deltaValue, System.Double elapsedTime, System.Double duration, Electron2D.Tween.TransitionType transType, Electron2D.Tween.EaseType easeType)Computes an eased interpolated value from an initial value and delta.
The normalized interpolation weight is clamped to the range
0 through 1. A zero duration produces the final supported
value immediately.
The supported type set is intentionally small for 0.1.0 Preview:
integer, floating-point, Electron2D.Vector2 and Electron2D.Color.
-
initialValue: The value at elapsed time zero. -
deltaValue: The difference between the final and initial values. -
elapsedTime: The finite non-negative elapsed time in seconds. -
duration: The finite non-negative duration in seconds. -
transType: The transition curve to apply. -
easeType: The ease mode to apply.
The interpolated value for supported numeric, Electron2D.Vector2 and
Electron2D.Color variants; otherwise, initialValue.
-
System.ArgumentOutOfRangeException: Thrown when a numeric argument is negative or not finite, or when an enum value is outside the supported range.
This method is safe to call from any thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.TweenProperty(Electron2D.Object,Electron2D.NodePath,Electron2D.Variant,System.Double)
Kind: Method
public System.Boolean IsRunning()()Checks whether this tween is currently advancing automatically.
This method follows the validation and lifetime rules of its declaring type.
true when this tween is valid, playing, has pending tweeners and
its bound node can be processed; otherwise, false.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween
Kind: Method
public System.Boolean IsValid()()Checks whether this tween is registered and can accept tweeners.
This method follows the validation and lifetime rules of its declaring type.
true when the tween is valid; otherwise, false.
This method is safe to call on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween
Kind: Method
public System.Void Kill()()Cancels this tween and removes it from scene tree processing.
Killing a tween clears pending tweeners and does not emit the
finished signal.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.Stop
Kind: Method
public System.Void Pause()()Pauses automatic processing for this tween.
Pausing preserves the current step and elapsed time. Use
Electron2D.Tween.Play to resume automatic processing or
Electron2D.Tween.CustomStep(System.Double) to advance manually while paused.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.Play
Kind: Method
public System.Void Play()()Starts or resumes automatic processing for this tween.
Calling this method after Electron2D.Tween.Pause resumes from the current
step. Calling it after Electron2D.Tween.Stop starts again from elapsed time
zero.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.PauseElectron2D.Tween.Stop
Kind: Method
public Electron2D.Tween SetEase(Electron2D.Tween.EaseType)(Electron2D.Tween.EaseType ease)Sets the default ease mode for subsequently added property tweeners.
Existing property tweeners keep the ease mode they had when they were
created or later changed through Electron2D.PropertyTweener.SetEase(Electron2D.Tween.EaseType).
-
ease: The ease mode to use.
This tween instance.
-
System.ArgumentOutOfRangeException: Thrown wheneaseis outside the supported enum range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.SetTrans(Electron2D.Tween.TransitionType)
Kind: Method
public Electron2D.Tween SetSpeedScale(System.Double)(System.Double speed)Sets the speed multiplier used by future tween processing steps.
A value of 1 advances at normal speed. A value of 0 keeps
the tween valid but prevents positive frame deltas from advancing time.
-
speed: The finite non-negative speed multiplier.
This tween instance.
-
System.ArgumentOutOfRangeException: Thrown whenspeedis negative or not finite.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween
Kind: Method
public Electron2D.Tween SetTrans(Electron2D.Tween.TransitionType)(Electron2D.Tween.TransitionType trans)Sets the default transition for subsequently added property tweeners.
Existing property tweeners keep the transition they had when they were
created or later changed through Electron2D.PropertyTweener.SetTrans(Electron2D.Tween.TransitionType).
-
trans: The transition curve to use.
This tween instance.
-
System.ArgumentOutOfRangeException: Thrown whentransis outside the supported enum range.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.SetEase(Electron2D.Tween.EaseType)
Kind: Method
public System.Void Stop()()Stops this tween and rewinds its sequence time.
Stop keeps the tween valid and does not roll target properties back.
Previously captured initial values are kept so a later Electron2D.Tween.Play
starts the same sequence again from time zero.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.Tween.KillElectron2D.Tween.Play
Kind: Method
public Electron2D.CallbackTweener TweenCallback(Electron2D.Callable)(Electron2D.Callable callback)Adds a callback tweener to this tween.
The callback is called once when its turn in the sequence is reached.
Calling Electron2D.Tween.Kill before the step is reached prevents the
callback from running.
-
callback: The callable to invoke when the sequence reaches this step.
The created Electron2D.CallbackTweener.
-
System.ArgumentException: Thrown whencallbackis null-like. -
System.InvalidOperationException: Thrown when this tween is not valid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.CallbackTweenerElectron2D.Tween.TweenInterval(System.Double)
Kind: Method
public Electron2D.IntervalTweener TweenInterval(System.Double)(System.Double time)Adds a time-only interval to this tween.
An interval consumes time without modifying target objects. It is useful for delaying later property or callback steps.
-
time: The non-negative interval duration in seconds.
The created Electron2D.IntervalTweener.
-
System.ArgumentOutOfRangeException: Thrown whentimeis negative or not finite. -
System.InvalidOperationException: Thrown when this tween is not valid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.IntervalTweenerElectron2D.Tween.TweenCallback(Electron2D.Callable)
Kind: Method
public Electron2D.PropertyTweener TweenProperty(Electron2D.Object, Electron2D.NodePath, Electron2D.Variant, System.Double)(Electron2D.Object object, Electron2D.NodePath property, Electron2D.Variant finalVal, System.Double duration)Adds a property tweener to this tween.
The property path may address a public property or field by name, and
may address nested public members with colon-separated subnames such as
Position:X.
The initial value is captured the first time this tweener starts. Later
calls to Electron2D.Tween.Stop reset elapsed time but keep that captured
initial value.
-
object: The object that owns the property. -
property: The property path to write. -
finalVal: The final value to assign when the tweener completes. -
duration: The non-negative duration in seconds.
The created Electron2D.PropertyTweener.
-
System.ArgumentNullException: Thrown whenobjectisnull. -
System.ArgumentOutOfRangeException: Thrown whendurationis negative or not finite. -
System.InvalidOperationException: Thrown when this tween is not valid.
This method is not synchronized. Call it on the main scene thread.
This method is available since Electron2D 0.1.0 Preview.
Electron2D.PropertyTweenerElectron2D.Tween.TweenCallback(Electron2D.Callable)Electron2D.Tween.TweenInterval(System.Double)
Electron2D 0.1.0 Preview API reference. Generated from 175 public runtime types.