API Reference › Tween › Tween.done
method

Tween.done

Tween.done(timer, duration) -> bool

Returns true once timer >= duration — the companion to Tween.progress for ending a one-shot tween: kick off the next step, clear a component, or snap the value to its target.

Parameters

timerelapsed seconds (a fixed)
durationthe tween's length in seconds (a fixed)

Example

program Demo {
  property Slide { timer: fixed = 0.0 }
  model Menu { Slide }
  handler Run phase Update {
    Slide.timer = Slide.timer + Time.delta()
    if Tween.done(Slide.timer, fixed(1)) { print(1) }
  }
}
← All symbols