Gládio Cítrico

Ramu 0.7b doc

doc homeRamu

SpritesheetAnimator.addAnimation()

Parameters

string nameID: Id to access the SpritesheetAnimation.
SpritesheetAnimation spritesheetAnimation: Animation to be attached.

Description

Add an animation frame.

You can test this snippet of code here.

let img = Ramu.Utils.getImage("https://raw.githubusercontent.com/HermesPasser/Ramu/master/demos/img/anim/crossSheet.gif");
let anim = new SpritesheetAnimation(img, 10, 10, 35, 35);
anim.addFrame([
  new Rect(43, 52, 35, 35),
  new Rect(3, 52, 35, 35),
  new Rect(83, 2, 35, 35)
]);

let animator = new SpritesheetAnimator(10, 10, 35, 35);
animator.addAnimation('anim1', anim);

See also SpritesheetAnimator.setCurrentAnimation.