Hour 6. Drawing Basic Shapes and Text

What You’ll Learn in This Hour

• How to draw shapes using Canvas

• How to print text using Canvas

• How to change draw settings with Paint

• How to write Javadoc code comments

In this hour you learn more about Canvas and View and about the many methods available for drawing shapes and text.

Drawing Basic Vector Shapes

As you saw in the previous hour, you can draw to the Android screen using Canvas and View. We take a look at most of the Canvas drawing methods here. Although you might not consider vector shapes useful, they can be handy for in-game editors, for highlighting game objects, for underlining or boxing areas, and even for simple games.

Drawing Circles

Because you have already seen a circle drawn ...

Get Sams Teach Yourself Android Game Programming in 24 Hours now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.