kroop Posted June 10, 2014 Share Posted June 10, 2014 Hello. Trying out Phaser. We currently use atlases for all the bitmap assets with starling and I'm trying to figure out if they would be working straight away with Phaser too, but I got stuck into really basic stuff. Loading the atlas in preload seems to be ok:game.load.atlasXML('atlas1', 'assets/atlas1.png', 'assets/atlas1.xml');Example line from the atlas1.xml pointing to a texture:<SubTexture height="54" width="84" y="2" x="868" name="btn_yes"/>The question is, how do I create a sprite out of that subtexture? Thanks! Link to comment Share on other sites More sharing options...
kroop Posted June 10, 2014 Author Share Posted June 10, 2014 Yeah found it from one of the examples in the end. Might come handy to leave it here in case someone else is looking for the same info.game.add.sprite(100, 200, 'atlas1', 'btn_yes'); Link to comment Share on other sites More sharing options...
Kishore Posted June 11, 2015 Share Posted June 11, 2015 It is not working in Mozilla.. and giving invalid XML.. Below mentioned is in my XML File <?xml version="1.0" encoding="utf-8"?><TextureAtlas imagePath="Fishing.png"><SubTexture name="blu-orng0000" x="30" y="30" width="66" height="68"/><SubTexture name="orng0000" x="101" y="30" width="66" height="50"/><SubTexture name="silver0000" x="30" y="103" width="82" height="56"/><SubTexture name="ylw0000" x="117" y="103" width="96" height="42"/><SubTexture name="ylw-blu0000" x="30" y="164" width="84" height="50"/><SubTexture name="ylw-white0000" x="119" y="164" width="82" height="56"/></TextureAtlas> Link to comment Share on other sites More sharing options...
Recommended Posts