bali33 Posted February 3, 2015 Share Posted February 3, 2015 Hi guys, I want to load an atlasXML and then create one Image instance for each frame it contains. Is it possible to retrieve all frame names or the total of frames the atlasXML contains ? Thank you Link to comment Share on other sites More sharing options...
Tom Atom Posted February 3, 2015 Share Posted February 3, 2015 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; clark 1 Link to comment Share on other sites More sharing options...
bali33 Posted February 3, 2015 Author Share Posted February 3, 2015 Thank you ! Link to comment Share on other sites More sharing options...
Recommended Posts