class
Opal::Animation::Tween
- Opal::Animation::Tween
- Reference
- Object
Overview
Flexible numeric animator supporting both delta updates and wall-clock timestamps
Defined in:
opal/style/animation.crConstructors
-
.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
-
.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
Instance Method Summary
- #current_val : Float64
- #current_value(now : Time::Instant = Time.instant) : Float64
- #duration : Time::Span
- #duration=(duration : Time::Span)
- #duration_ms : Int64
- #duration_ms=(duration_ms : Int64)
- #easing : Easing
- #easing=(easing : Easing)
- #elapsed : Float64
- #finished=(finished : Bool)
- #finished?(now : Time::Instant = Time.instant) : Bool
- #from : Float64
- #from=(from : Float64)
- #looping=(looping : Bool)
- #looping? : Bool
- #on_complete(&block : -> Nil) : self
- #on_update(&block : Float64 -> Nil) : self
- #progress : Float64
- #start_time : Time::Instant
- #to : Float64
- #to=(to : Float64)
- #update(dt : Float64) : Float64
- #yoyo=(yoyo : Bool)
- #yoyo? : Bool
Constructor Detail
def self.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
def self.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