Aego Русский

Tween

type Tween

Tween animates one property of a node. A finished, stopped or nil tween reads as done; yield t waits until it ends.

Tween.Curve method

func (Tween) Curve(curve Curve) Handle<aego/tween.Tween>

Replaces the easing with a curve field; its time range is stretched over the duration.

Tween.Delay method

func (Tween) Delay(seconds float) Handle<aego/tween.Tween>

Waits before the tween starts; the start value is read when the delay ends. Call it right after creating the tween.

Example

tween.ToFloat(node, "Light.Range", 4, 1, curve.Linear).Delay(0.5)

Tween.Done method

func (Tween) Done() bool

Reports whether the tween finished, was stopped or is nil.

Tween.Loop method

func (Tween) Loop(count int) Handle<aego/tween.Tween>

Plays the tween n times from the start; -1 repeats until Stop.

Tween.PingPong method

func (Tween) PingPong(legs int) Handle<aego/tween.Tween>

Plays n legs, every second one backwards; 2 goes there and back, -1 repeats until Stop.

Tween.Running method

func (Tween) Running() bool

Is the opposite of Done.

Tween.Stop method

func (Tween) Stop()

Ends the tween where it is; the property keeps its current value.

Tween.Unscaled method

func (Tween) Unscaled() Handle<aego/tween.Tween>

Runs the tween in real time, also while the game is paused.

Tween.Completed signal

signal Completed(finished bool)

Runs once when the tween ends. Its finished parameter is true at the natural end, false after Stop, when a new tween on the same property replaced it, or when its node or target is gone.