Sprite sheet load
Description:loads a sprite sheet
Example:this.load.spritesheet('key', 'path', { frameWidth: width, frameHeight: height});
get frame names
Description:get the frame names of a sprite sheet
Example:var textureFrames = this.textures.get('key').getFrameNames();
create an animation
Description:create an animation
Example:this.anims.create({
key: 'animationName',
frames: [
{ key: 'key1',:frame:frame1 },
{ key: 'key2',:frame:frame2 },
],
frameRate: rate,
repeat: -1
});
Play an animation
Description:play an animation
Example:sprite.play('animationName');
get frame numbers
Description:generate frame numbers from a sprite sheet. Will return an object such as:
{ key: 'char',frame:1 },
{ key: 'char',frame:2 },
Example: var frameNames= this.anims.generateFrameNumbers('key');
animation complete event
Description:calls a function when animation is complete
Example:char.on('animationcomplete', function, scope);
Generate a key frame sequence
Description:generate a key frame sequence from a JSON file
Example:this.anims.generateFrameNames('ninja', {start: 0, end: 8, zeroPad: 3, prefix: 'Attack__', suffix: '.png'})