class

Opal::Animation::Tween

Inherits Reference < Object

Flexible numeric animator supporting both delta updates and wall-clock timestamps

Constructors

new(from_val : Float64, to_val : Float64, duration : Time::Span, easing : Easing | Symbol = Easing::Linear, yoyo : Bool = false, looping : Bool = false)

Modern span/delta constructor

Source
new(from : Float64, to : Float64, duration_ms : Int64 = 300_i64, easing : Symbol = :ease_out_quad, start_time : Time::Instant = Time.instant)

Legacy ms/instant constructor

Source

Instance methods

current_val
Source
current_value(now : Time::Instant = Time.instant) : Float64
Source
duration
Source
duration=(duration : Time::Span)
Source
duration_ms
Source
duration_ms=(duration_ms : Int64)
Source
easing
Source
easing=(easing : Easing)
Source
elapsed
Source
finished=(finished : Bool)
Source
finished?(now : Time::Instant = Time.instant) : Bool
Source
from
Source
from=(from : Float64)
Source
looping=(looping : Bool)
Source
looping?
Source
on_complete
Source
on_update
Source
progress
Source
start_time
Source
to=(to : Float64)
Source
update(dt : Float64) : Float64
Source
yoyo=(yoyo : Bool)
Source
yoyo?
Source