256
Graphics / Strip images
« on: October 20, 2008, 04:26:09 pm »
Hm.. What do you mean? What member?
Imagine a fall down animation witch have 2 frames:
- I can save the 2 frames horizontally aligned in a unique image, and there will be junk pixels because second pic height is smaller than the first one.
Then a sprite will use setSubRect to have first or second frame (according to the size of each frame, stored somewhere)
Its one image like this:
- Alternatively, frames are saved as separated images, without junk pixels, and the sprite will use setImage to have first or second frame.
It's two Images like this:
Thinking that I could have much animations, each one with much frames of different sizes, how different could be the 2 alternatives? Shouldn't I care about the extra memory used to store unused pixels in strip-images? How much better (or not) would be using a big image instead of 50 small ones (for instance)
Imagine a fall down animation witch have 2 frames:
Code: [Select]
\o/
| and =-|o
- I can save the 2 frames horizontally aligned in a unique image, and there will be junk pixels because second pic height is smaller than the first one.
Then a sprite will use setSubRect to have first or second frame (according to the size of each frame, stored somewhere)
Its one image like this:
Code: [Select]
_________
|\o/=-|o|
| | ####| <-- junk pixels in bottom right
---------
- Alternatively, frames are saved as separated images, without junk pixels, and the sprite will use setImage to have first or second frame.
It's two Images like this:
Code: [Select]
_____ ______
|\o/| and |=-|o|
| | | ------
-----
Thinking that I could have much animations, each one with much frames of different sizes, how different could be the 2 alternatives? Shouldn't I care about the extra memory used to store unused pixels in strip-images? How much better (or not) would be using a big image instead of 50 small ones (for instance)