class Tessell::Anim::Track(O)

Overview

单条合成动画轨。state_at 为闭式采样:结果只依赖时刻,不依赖采样历史。

Defined in:

tessell/anim.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(key : UI::UiKey, start_ms : Int64, opacity_from : Float32 = 1.0_f32, opacity_to : Float32 = 1.0_f32, tx_from : Float32 = 0.0_f32, tx_to : Float32 = 0.0_f32, ty_from : Float32 = 0.0_f32, ty_to : Float32 = 0.0_f32, scale_from : Float32 = 1.0_f32, scale_to : Float32 = 1.0_f32, duration_ms : Int64 = 300_i64, delay_ms : Int64 = 0_i64, easing : Proc(Float32, Float32) = ->Anim::Easing.linear(Float32), owner : O | Nil = nil) #

[View source]

Instance Method Detail

def delay_ms : Int64 #

[View source]
def duration_ms : Int64 #

[View source]
def easing : Proc(Float32, Float32) #

[View source]
def finished?(now_ms : Int64, reduced_motion : Bool = false) : Bool #

[View source]
def key : UI::UiKey #

[View source]
def on_cancel : Proc(Nil) | Nil #

[View source]
def on_cancel=(on_cancel : Proc(Nil) | Nil) #

[View source]
def on_finish : Proc(Nil) | Nil #

[View source]
def on_finish=(on_finish : Proc(Nil) | Nil) #

[View source]
def owner : O | Nil #

[View source]
def state_at(now_ms : Int64, reduced_motion : Bool = false) : CompositeState #

闭式采样:t = clamp((now - start - delay) / duration)。 reduced_motion 直接取终值(无过渡)。


[View source]