sprite.addAnimationFrame

Section: Sprite Animation

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

  • id
  • u1
  • v1
  • u2
  • v2
  • durationoptional

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.

49 members in sprite