Jump to content

Need ideas on why texture atlas not working


tonetheman
 Share

Recommended Posts

I used ShoeBox to generate a texture atlas for lot of little tiny sprites.

 

This is a sample from the top of the file.

{"frames": {"tiles_0.png": {"frame": {"x":100, "y":25, "w":24, "h":24},"spriteSourceSize": {"x":0,"y":0,"w":24,"h":24},"sourceSize": {"w":24,"h":24}},"tiles_1.png": {"frame": {"x":100, "y":0, "w":24, "h":24},"spriteSourceSize": {"x":0,"y":0,"w":24,"h":24},"sourceSize": {"w":24,"h":24}},
When I load the texture atlas I get no errors.
this.game.load.atlas("tiles", "sprites.png", "sprites.js",null, Phaser.Loader.TEXTURE_ATLAS_JSON_ARRAY);
When I try to use a single image from the file I get an error
game.add.sprite(100,100,"tiles","tiles_0.png");
Will generate this error in the console and show the entire spritesheet on screen.
phaser.js:51356 Cannot set frameName: tiles_0.png

From the reading I have done my spritesheet is in the jsonarray format and not the hash format. I also tried to load the spritesheet without the last two arguments and let Phaser figure it out (this did not work either).

 

I traced it down a little bit in phaser.js and it looks like my _frameData is not really loaded with anything. Is ShoeBox a bad program to generate texture atlas js files?

 

thanks for any thoughts.

 

 

Link to comment
Share on other sites

Gah.... how did I get that so backwards?

 

Super duper thanks I tested it just now and that was it.

 

I randomly switched out about every other thing. I had convinced myself I had that one parameter correct and had not randomly changed it to see if I could get it work... haha.

 

thanks!

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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