16.4 Examples

A sample sprite library demonstration program is provided in under /usr/src/PR/demos/spgame. The demo shows how to use sprite library to do backgrounds, texts and a simple animation.

UP


16.4.1 Backgrounds

Setting up copy mode. TLUT to animate it. Scrolling Background example (up/down, left/right)

UP


16.4.2 Text (Fonts)

void text_sprite(Sprite *txt, char *str, Font *fnt, int xlen, int ylen)

This creates the appropriate bitmap to rendering the specified string in the indicated sprite. You can use a two-pass approach to render a larger number of characters.

UP