[cocos2d-html5 2.1.1] Rotated sprites within spritesheet are not showing up

I’m writing a game with a spritesheet made with TexturePacker. Most of times, some sprites included in the spritesheet are rotated to better organize the sprites.

I’m noticing that in my game these sprites are not showing up. See the image included in this post. In this case the buildings at the sides were done vertically and TexturePacker stores them horizontally inside the spritesheet.

I have to reload the game with F5 to have it display the sprites correctly as in the left side of the image. Sometimes this doesn’t even solve the problem.

My game has only one scene, inside the scene there are two nodes (working as layers). Street sprites are contained in one node, and player sprites are contained in another. All sprites used in the game are contained in the spritesheet.

Am I missing something when loading the spritesheet? Console does not show any errors, so I’m basically lost on what’s happening here. I’m also already loading the games from a local httpd server, so they’re not loaded from file://.


buho-comp.jpg (63.8 KB)

If you have to refresh the page to see, it is most likely that the image file was not preloaded.
Please check that the image file is preloaded, you probably need to add it to the “resources.js” file

Indeed, I have to reload to see the images.

There is only one resource to be added, the spritesheet, a .plist.

Added in g_ressources:

var s_game_plist = “res/game.plist”;
var g_ressources = [{type: “plist”, src: s_game_plist}];

And called this in the ctor function in cocos2dApp:

cc.Loader.getInstance().preload(g_ressources);

The code was copied from HelloHTML5World and modified from there. Probably should have copied from template? I don’t know what I’m doing wrong.