tonetheman Posted April 22, 2015 Share Posted April 22, 2015 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 errorgame.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.pngFrom 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. spinnerbox 1 Link to comment Share on other sites More sharing options...
stauzs Posted April 22, 2015 Share Posted April 22, 2015 seems that you are using TEXTURE_ATLAS_JSON_HASH format changing to:this.game.load.atlas("tiles", "sprites.png", "sprites.js", null, Phaser.Loader.TEXTURE_ATLAS_JSON_HASH);should work spinnerbox 1 Link to comment Share on other sites More sharing options...
rich Posted April 22, 2015 Share Posted April 22, 2015 Just so you can tell for yourself in future:{"frames": {This is a json atlas hash, because the frames object starts with a {{"frames": [This is a json atlas array, because the frames object starts with a [. clark 1 Link to comment Share on other sites More sharing options...
tonetheman Posted April 22, 2015 Author Share Posted April 22, 2015 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 More sharing options...
rich Posted April 23, 2015 Share Posted April 23, 2015 https://github.com/photonstorm/phaser/commit/30450cb9bc67f43c7ced3fc0493210aebc5d430e Titus 1 Link to comment Share on other sites More sharing options...
Recommended Posts