What it does
sprite.addAnimationFrame adds AnimationFrame on a sprite object. It takes id, u1, v1, u2, v2 and duration. duration is optional.
Signature
sprite.addAnimationFrame(id, u1, v1, u2, v2, duration?)Arguments
idu1v1u2v2durationoptional
Example · generated
function start() { sprite.addAnimationFrame('animationFrame', 0, 120, 0, 120);}sprite.addAnimationFrame is called with values of the shape its signature asks for. The code sits in start(), which the engine calls once, when the entity spawns.