Skip to content

Class Tween

Namespace: Apogee.Scripting
Assembly: Apogee.Scripting.dll

An animation that tween.value, tween.property and tween.field start: a number, a vector, a colour (a linear-RGB vector) or a rotation (slerped) moving from one value to another over some seconds, with an easing curve. It plays by itself, on the game clock (or the real clock with the unscaled option), stepped by . A playing tween stays alive when the script drops the handle. A tween on a property or a component field makes no Luau call per frame.

public sealed class Tween : EngineObject

Inheritance

object ← EngineObject ← Tween

Inherited Members

EngineObject.IsAdopted, EngineObject.Handle, EngineObject.IsDestroyed, EngineObject.Class, EngineObject.Adopt(), EngineObject.TryGet(SlotHandle, out EngineObject), EngineObject.Destroy(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.ReferenceEquals(object?, object?), object.ToString()

Properties

Cancelled

Emitted once when the tween ends early: , a setter that raised an error, or a target that is gone (a destroyed object, a dead entity, a removed component).

public Signal Cancelled { get; }

Property Value

Signal

Class

What the registry knows about this object's class.

public override ClassInfo Class { get; }

Property Value

ClassInfo

Completed

Emitted once when the tween ends by reaching its last value, after that value is written. A tween that repeats forever never emits it.

public Signal Completed { get; }

Property Value

Signal

Duration

The seconds one pass takes (not counting the delay or the repeats).

public double Duration { get; }

Property Value

double

Ease

The easing curve.

public Ease Ease { get; }

Property Value

Ease

Paused

True while the tween is paused with . An ended tween is not paused.

public bool Paused { get; }

Property Value

bool

Playing

True while the tween runs (it is not paused and has not ended).

public bool Playing { get; }

Property Value

bool

Progress

How far the current pass has got, from 0 to 1, in time (the easing curve is not applied). It is 1 once the tween has completed.

public double Progress { get; }

Property Value

double

Methods

Cancel()

Stops the tween where it is: the value stays what the last step wrote, and cancelled is emitted. Does nothing once the tween has ended.

public void Cancel()

Complete()

Jumps to the end value (the last pass's: to, or from when the tween reverses an odd number of times), writes it and emits completed. For a tween that repeats forever it stops at to. Does nothing once the tween has ended.

public void Complete()

Pause()

Holds the tween, delay included, until . A paused tween is still alive: it keeps the object it animates and does not end.

public void Pause()

Resume()

Lets a paused tween go on from where it stopped.

public void Resume()