timer(maxLoopsPerFrame?: number): TimerComp
Enable timer related functions like wait(), loop(), tween() on the game object.
param
maxLoopsPerFrame- The maximum number of loops per frame.
const obj = add([ timer(), ]) obj.wait(2, () => { ... }) obj.loop(0.5, () => { ... }) obj.tween(obj.pos, mousePos(), 0.5, (p) => obj.pos = p, easings.easeOutElastic)
returns
The timer comp.
since
v2000.0