Jump to content

Using atlasXML


kroop
 Share

Recommended Posts

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

  • 1 year later...

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

 Share

  • Recently Browsing   0 members

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