O'Reilly logo

Sams Teach Yourself Android Game Programming in 24 Hours by Jonathan S. Harbour

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required