method
Tween.ease
Tween.ease(t, mode) -> fixed
Shapes a normalized amount t (0.0..1.0) through one of the engine's easing curves and returns the eased fixed. mode must be a literal integer selecting the curve — the same curves as the Ease namespace:
- 0 — linear
- 1 — ease-in (quadratic)
- 2 — ease-out (quadratic)
- 3 — smooth ease-in-out
- 4 — ease-in-back (overshoots below 0)
- 5 — ease-out-elastic (springy settle)
- 6 — ease-out-bounce
Parameters
tthe amount to shape (a fixed in 0..1, e.g. from Tween.progress)modea literal int 0..6 selecting the curveExample
program Demo {
handler Run phase Update {
let t = Tween.progress(fixed(1), fixed(2))
let e = Tween.ease(t, 4) # ease-in-back
let x = Tween.round(0, 200, e)
print(x)
}
}