Jump to content

How to retrieve all atlasXML frames ?


bali33
 Share

Recommended Posts

Hi, in my opinion it does not matter whether the atlas is loaded from XML or JSON. Let's say you atlas has name 'Atlas'. Onece it is loaded you can get number of frames like this:

var frameCount: number = this.cache.getFrameCount('Atlas');

 If you need individual frames then do this:

var frame: Phaser.Frame = this.cache.getFrameByName('Atlas', 'frame_name');

 This will tell you which index in atlas is previously asked frame or what is its width and height:

var baseIndex: number = frame.index;var width: number = frame.width;var height: number = frame.height;
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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