class Opal::Animation::Tween

Overview

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

Defined in:

opal/style/animation.cr

Constructors

Instance Method Summary

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


[View source]
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


[View source]

Instance Method Detail

def current_val : Float64 #

[View source]
def current_value(now : Time::Instant = Time.instant) : Float64 #

[View source]
def duration : Time::Span #

[View source]
def duration=(duration : Time::Span) #

[View source]
def duration_ms : Int64 #

[View source]
def duration_ms=(duration_ms : Int64) #

[View source]
def easing : Easing #

[View source]
def easing=(easing : Easing) #

[View source]
def elapsed : Float64 #

[View source]
def finished=(finished : Bool) #

[View source]
def finished?(now : Time::Instant = Time.instant) : Bool #

[View source]
def from : Float64 #

[View source]
def from=(from : Float64) #

[View source]
def looping=(looping : Bool) #

[View source]
def looping? : Bool #

[View source]
def on_complete(&block : -> Nil) : self #

[View source]
def on_update(&block : Float64 -> Nil) : self #

[View source]
def progress : Float64 #

[View source]
def start_time : Time::Instant #

[View source]
def to : Float64 #

[View source]
def to=(to : Float64) #

[View source]
def update(dt : Float64) : Float64 #

[View source]
def yoyo=(yoyo : Bool) #

[View source]
def yoyo? : Bool #

[View source]