Jump to content

unable to import spritesheet with atlasXML


Recommended Posts

Hi there,


I am new to phaser i started just yesterday. so i wanted to make a simple platformer game. But phaser crashes right at the beginning. i tracked it down and the problem is with atlasXML load of a spritesheet.


its throwing the error - 

Uncaught Error: Texture Error: frame does not fit inside the base Texture dimensions [object Object]

the import is like this - 

game.load.image('background', 'assets/bg.png');game.load.atlasXML('hud', 'assets/hud_spritesheet.png', 'assets/hud_spritesheet.xml');game.load.atlasXML('items', 'assets/items_spritesheet.png', 'assets/items_spritesheet.xml');game.load.atlasXML('tiles', 'assets/tiles_spritesheet.png', 'assets/tiles_spritesheet.xml');game.load.atlas('player', 'assets/p1_walk.png', 'assets/p1_walk.json');game.load.atlasXML('enemies', 'assets/enemies_spritesheet.png', 'assets/enemies_spritesheet.xml');

only the last line is creating error the enemies line....

i check the format of its xml file its exactly the same as the other xml files...here's an example....



<TextureAtlas imagePath="sheet.png">	<SubTexture name="blockerBody.png" x="76" y="0" width="51" height="51" />	<SubTexture name="blockerMad.png" x="118" y="148" width="51" height="51" />	<SubTexture name="blockerSad.png" x="67" y="69" width="51" height="51" />	<SubTexture name="fishDead.png" x="0" y="69" width="66" height="42" />	<SubTexture name="fishSwim1.png" x="0" y="112" width="66" height="42" />	<SubTexture name="fishSwim2.png" x="0" y="155" width="62" height="43" />	<SubTexture name="flyDead.png" x="0" y="212" width="59" height="33" />	<SubTexture name="flyFly1.png" x="0" y="32" width="72" height="36" />	<SubTexture name="flyFly2.png" x="0" y="0" width="75" height="31" />	<SubTexture name="pokerMad.png" x="128" y="0" width="48" height="146" />	<SubTexture name="pokerSad.png" x="177" y="0" width="48" height="146" />	<SubTexture name="slimeDead.png" x="0" y="199" width="59" height="12" />	<SubTexture name="slimeWalk1.png" x="118" y="200" width="50" height="28" />	<SubTexture name="slimeWalk2.png" x="67" y="121" width="51" height="26" />	<SubTexture name="snailShell.png" x="170" y="147" width="44" height="30" />	<SubTexture name="snailShell_upsidedown.png" x="169" y="200" width="44" />	<SubTexture name="snailWalk1.png" x="63" y="155" width="54" height="31" />	<SubTexture name="snailWalk2.png" x="60" y="199" width="57" height="31" /></TextureAtlas>


<TextureAtlas imagePath="sheet.png">	<SubTexture name="hud_0.png" x="230" y="0" width="30" height="38"/>	<SubTexture name="hud_1.png" x="196" y="41" width="26" height="37"/>	<SubTexture name="hud_2.png" x="55" y="98" width="32" height="38"/>	<SubTexture name="hud_3.png" x="239" y="80" width="28" height="38"/>	<SubTexture name="hud_4.png" x="238" y="122" width="29" height="38"/>	<SubTexture name="hud_5.png" x="238" y="162" width="28" height="38"/>	<SubTexture name="hud_6.png" x="230" y="40" width="30" height="38"/>	<SubTexture name="hud_7.png" x="226" y="206" width="32" height="39"/>	<SubTexture name="hud_8.png" x="192" y="206" width="32" height="40"/>	<SubTexture name="hud_9.png" x="196" y="0" width="32" height="39"/>	<SubTexture name="hud_coins.png" x="55" y="0" width="47" height="47"/>	<SubTexture name="hud_gem_blue.png" x="104" y="0" width="46" height="36"/>	<SubTexture name="hud_gem_green.png" x="98" y="185" width="46" height="36"/>	<SubTexture name="hud_gem_red.png" x="98" y="147" width="46" height="36"/>	<SubTexture name="hud_gem_yellow.png" x="98" y="223" width="46" height="36"/>	<SubTexture name="hud_heartEmpty.png" x="0" y="47" width="53" height="45"/>	<SubTexture name="hud_heartFull.png" x="0" y="94" width="53" height="45"/>	<SubTexture name="hud_heartHalf.png" x="0" y="0" width="53" height="45"/>	<SubTexture name="hud_keyBlue.png" x="146" y="147" width="44" height="40"/>	<SubTexture name="hud_keyBlue_disabled.png" x="150" y="38" width="44" height="40"/>	<SubTexture name="hud_keyGreem_disabled.png" x="104" y="38" width="44" height="40"/>	<SubTexture name="hud_keyGreen.png" x="192" y="122" width="44" height="40"/>	<SubTexture name="hud_keyRed.png" x="193" y="80" width="44" height="40"/>	<SubTexture name="hud_keyRed_disabled.png" x="192" y="164" width="44" height="40"/>	<SubTexture name="hud_keyYellow.png" x="146" y="189" width="44" height="40"/>	<SubTexture name="hud_keyYellow_disabled.png" x="147" y="80" width="44" height="40"/>	<SubTexture name="hud_p1.png" x="55" y="49" width="47" height="47"/>	<SubTexture name="hud_p1Alt.png" x="0" y="141" width="47" height="47"/>	<SubTexture name="hud_p2.png" x="49" y="141" width="47" height="47"/>	<SubTexture name="hud_p2Alt.png" x="0" y="190" width="47" height="47"/>	<SubTexture name="hud_p3.png" x="49" y="190" width="47" height="47"/>	<SubTexture name="hud_p3Alt.png" x="98" y="98" width="47" height="47"/>	<SubTexture name="hud_x.png" x="0" y="239" width="30" height="28"/></TextureAtlas>

both the format are exactly the same but only enemies one is creating errors...

i tried using shoebox to export the sprite sheet in 'Starling, Sparrow' format...but it still didn't work.

i hope i have provided all the info needed...

Please help me out on how i can fix this problem and what might be causing it....

Link to comment
Share on other sites


  • Recently Browsing   0 members

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