Jump to content

animation frame range index


Recommended Posts

Is it possible to give the animation a frame index range instead of listing all the frames


something like this


this.flame.animations.add('burn2',[29,59]); // will play from frame 29 - 59
this.flame.animations.add('burn',[0,59,'burn2]); // will play from 0 - 59 then play burn2 animation


Thanks, haven't seen anything in the docs for this. :)



Link to comment
Share on other sites

If they are integers you need then you can do it like this:

animations.add('burn', game.math.numberArray(29, 59));

If you need frames from a texture atlas, then use Phaser.Animation.generateFrameNames instead.


Thanks for the array generator. 

I'm curious too.. I have been using createjs, its  a canvas drawing api and a pretty powerful one, but wanted to try out phaser. 


One thing createjs does is allow me to name animations like 

animations.add ('burn',[frames]);// then create another animation that uses some frames but also another animation.animations.add('burn2',[frames, 'burn'] // so this one at the end of all the frames plays the burn animation aswell.

Is this something that i would have to do manually? I'm assuming its not integrated in this system?  

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...