Tweens and timers
A tween moves one property of a node from its current value to a target over time; a timer counts down and fires. Both run during Play and in aego run, belong to the play world and allocate nothing per frame once created.
import (
"aego/curve"
"aego/timer"
"aego/tween"
)
func Hurt() coroutine {
yield tween.ToColor(node, "SpriteRenderer.Tint", HitTint, 0.1, curve.OutQuad)
yield tween.ToColor(node, "SpriteRenderer.Tint", Color{1, 1, 1, 1}, 0.3, curve.InQuad)
}
- Property paths A tween names its property by a path, resolved once when the tween starts.
- Tweens in scripts A tween changes one property of a node from its current value to a target over a duration.
- Timers A timer made by a script belongs to that script's node and is cancelled when the node is destroyed.
- Waiting in coroutines
yieldwaits for a tween or a timer: - Actions An action runs tweens and timers in order or together:
- Go
TweenOptionshasEase,Curve,Delay,Legs,PingPongandUnscaled.