12.3. Sprites

A Sprite is a basic visual element whose appearance is provided by one of several frames stored in an Image. The developer can control which frame is used to render the Sprite, thereby enabling animation effects. Several transforms such as flipping and rotation can also be applied to a Sprite to further vary its appearance. As with all Layer subclasses, a Sprite's location can be changed, and it can also be made visible or invisible.

12.3.1. Frames

The raw frames used to render a Sprite are provided in a single Image object, which may be mutable or immutable. If more than one frame is used, they are packed into the Image as a series of equally-sized frames. The frames are defined when the Sprite is instantiated; they can also be ...

Get Programming Wireless Devices with the Java™ 2 Platform, Micro Edition, Second Edition 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.