O'Reilly logo

Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition by Jim Holliday - Editor, Aleksi Uotila, Mark Patel, Jyri Huopaniemi, Jim Van Peursem, Antero Taivalsaari, Roger Riggs

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

12.2. Layers

The Layer class is an abstract class that represents a basic visual entity that can be rendered on the screen. A Layer has defined rectangular bounds, and it can be either visible or invisible. A Layer can be rendered using any Graphics object by calling its paint method.

The game API defines two Layer subclasses: Sprite and TiledLayer. Unfortunately, class Layer cannot be directly subclassed by the developers, since this would compromise the ability to improve performance through the use of native code in the implementation of the Game API.

Subclasses of class Layer can be drawn at any time using the paint method. The Layer will be drawn on the Graphics object according to the current state information maintained by the Layer object ...

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