I have some CCSprites
that are children of a CCParallaxNode
that scroll horizontally. They are all the same size, i.e, 2048X640 (for the -hd versions, 1024X320 for the non-hd), but they contains large amounts of transparency. For example, the clouds sprite is a thin, wispy layer of clouds and the rest is transparent. Do I take a performance hit by using the big image - should I be trimming it down to the minimum height and setting the vertical position manually, rather that laying all the sprites at the origin?
UPDATE: I trimmed all the layers down to their minimum heights (still 2048 or 1024 wide depending on display) and the framerate went from less than 30 to close to 50. So, yeah, big hit!
You probably are taking a big performance hit for that. I bet if you trimmed the images down, you would see a drop in the file size, as well as a huge drop in the amount of memory that the images take up.
An image of dimensions 2048 x 640 would be stored as 2048 x 1024... which is massive. A texture that large isn't even supported on anything before a 3GS I believe. It doesn't matter that it is mostly transparent, it still needs to store the whole texture.