Sprites from sprite sheet showing as black rectangles!?

Hi!

After publishing my sprite sheet from texture packer all my sprites are shown like this!:


I have this sprite sheet:
Plist: http://s000.tinyupload.com/?file_id=01887599065173856726
Image:
http://s000.tinyupload.com/?file_id=00002295322949649632

And btw i have a deadline for the app and that is today so i am kinda frustrated :frowning:

Thanks!

hello there

I downloaded your spritesheet and tried to open it in cocos creator, it appears that there is something wrong with your plist file (it contains the names of your sprites but appearantly can’t load data from the png), though I cannot guess what’s wrong, the error comes from the plist file.

I would try again exporting it again maybe with some different settings.

hope this helps a little

1 Like

Thank you so much- i really appreciate it!
Fixed it by removing some of the biggest sprites… Do not know why that worked though

Hi,

the problem is your final texture size for the sprite sheet.
You have to keep the maximum size under 4096 - your sheet is 4240 high.

For best quality try to stay below 2048x2048.
You can enable rotated sprites - this should give you a better packing ratio.

Best
Andreas

Great. Thank you!
But does that also mean that sprites that are about 400x400 or so are not supposed to be in a sprite sheet?

There are several cost factors when it comes to sprites

  1. Cost for storage / app size / download
  2. Cost for loading the sprites (opening files, decoding pngs,…)
  3. Cost for rendering - switching textures in OpenGL, drawing pixels,…

A sprite sheet will help you reduce all of them. So it’s usually good to pack whatever is possible in a sprite sheet.

When you use multiple sprite sheets at the same time (which cocos2d perfectly supports) you still end up with big benefits. But you might pay the price for switching textures from time to time. You don’t have to care about this - it’s handled by cocos2d’s auto batching. Just load the sprite sheets and use the sprites. Don’t use a SpriteBatch. It’s deprecated.

You can use TexturePacker’s MultiPack. It’ll create several textures for you - optimizing the space.