Functions | |
void | oslSetImageFrameSize (OSL_IMAGE *img, u16 width, u16 height) |
void | oslSetImageFrame (OSL_IMAGE *img, int frame) |
A basic system allowing you to cut your images just as if they were sprites. Remember that the maximum size of an image is 512x512!
|
inline |
Defines the size of a frame in an image. This prepares the image for an use as a sprite sheet. In a sprite sheet, you have to arrange your sprites (small images) in a grid, whose dimensions are fixed. That is, if you decide for example that the sprite size is 29x37, EVERY sprite must have the same size, and be padded if it doesn't. Sprites are placed from left to right, and then on the next line from top to bottom (just like the text you are reading). For example, a 64x64 image containing 32x32 sprites (total: 4 sprites) would have the following disposition:
Important: The maximum size of an image is 512x512! See considerations with oslCreateImage.
void oslSetImageFrame | ( | OSL_IMAGE * | img, |
int | frame | ||
) |
To make a smart use of this feature, remember that you can always code macros to simplify and wrap your code.