7. Text

We used text when we were creating the text menus in Chapter 3. In this chapter, however, we look at the ways text is used in AndEngine in more detail. We examine fonts, we look at the game elements that use text, and we learn how to create and use our own unique fonts with AndEngine.

Fonts and Typefaces

The terms “font” and “typeface” are sometimes used interchangeably, but they have distinct meanings. A typeface is something like Arial or Droid Sans, each of which defines a set of characters that map to the character codes for ASCII and Unicode. A font combines a typeface with a size (e.g., 16 points, where a point is 1/72nd of 1 inch) and a style (e.g., bold or italic).

Three basic methods can be used to generate the physical representation ...

Get Learning Android Game Programming: A Hands-On Guide to Building Your First Android Game now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.