O'Reilly logo

Java™ ME Game Programming, Second Edition by Ph.D. Martin J. Wells, Ph.D. John P. Flynt

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

GameCanvas

The primary responsibility of the GameCanvas class is to allow you to manage the objects you display during the life of a game and the key events that you use to change those objects. While it offers only five new methods beyond those provided by the Canvas class, these methods are all extraordinarily helpful. For example, the getGraphics() method enables you to implement calls to Graphics methods without also having to center your activities using the paint() method. The getKeyStates() method provides a refined approach to processing messages. The flushGraphics() method is overloaded to enable you to render the contents of a selected region. With respect to message processing, as the discussion in Table 14.1 reveals, the GameCanvas ...

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