Copyright by Daniel Schuller

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

Chapter 7. Rendering Text

Most games need text—at the very least to display a score or menu.

Text rendering is also very useful for rendering out variable values as the game is running. A basic font system can be made very simply; each letter and number is represented as a sprite. Then a string of text is translated into a list of sprites. This method is easy to extend to any language, though Asian languages such as Chinese will need a larger number of textures to account for all the different glyphs.

Font Textures

Figure 7.1 is a texture with the entire Roman alphabet, numbers, and some punctuation marks. This is a great base to use to draw text. Such textures are easy to create if the correct tools are used. An excellent tool for bitmap fonts is ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required