Jump to content

Atlas: Cannot set frameName warning


hellspawn_bg
 Share

Recommended Posts

I recently came across this warning, while trying to pack my images into a single texture atlas. I have prepared the atlas with TexturePacker using JSON Hash. For the purpose of the demo I have created a texture with 2 images inside. I have set the texture size to power of 2. 

 

The content of the JSON file is:

{"frames": {"cat.png":{"frame": {"x":2,"y":68,"w":50,"h":50},"rotated": false,"trimmed": false,"spriteSourceSize": {"x":0,"y":0,"w":50,"h":50},"sourceSize": {"w":50,"h":50},"pivot": {"x":0.5,"y":0.5}},"dog.png":{"frame": {"x":2,"y":2,"w":80,"h":64},"rotated": false,"trimmed": false,"spriteSourceSize": {"x":0,"y":0,"w":80,"h":64},"sourceSize": {"w":80,"h":64},"pivot": {"x":0.5,"y":0.5}}},"meta": {"app": "http://www.codeandweb.com/texturepacker","version": "1.0","image": "gameContent.png","format": "RGBA8888","size": {"w":128,"h":128},"scale": "1","smartupdate": "$TexturePacker:SmartUpdate:4d5d08212283de860125419268743cc3:0b7ce17362320bea73869f2c1a9da2bb:e88dd6268be3835132a863977762ea7c$"}}

In my pre-loader I am loading the atlas using:

this.load.atlas('gameContent', 'assets/images/test/gameContent.png', 'assets/images/test/gameContent.json');

In my create function, I am loading the cat only:

this.cat = this.game.add.sprite(0, 0, 'gameContent', 'cat.png');

Upon startup I am seeing this warning in the console.

Cannot set frameName: cat.png 

And instead of loading only the cat from the atlas, it loads the hole gameContent.png. 

 

atlas.png

 

Am I missing something here?

 

Thanks :)

Link to comment
Share on other sites

  • 9 months later...

I got the same error for a specific png in my atlas made in TexturePacker.

tried load.atlasJSONHash and got worse results - many other png's in the atlas got error..

 

is load.atlasJSONHash syntax different from load.atlas ?

what do you suggest trying?

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

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