The Game API package provides a series of classes that enable the development of rich gaming content

类别:Java 点击:0 评论:0 推荐:
javax.microedition.lcdui.game Classes 
GameCanvas
Layer
LayerManager
Sprite
TiledLayer

API OverviewThe API is comprised of five classes: GameCanvasThis class is a subclass of LCDUI's Canvas and provides the basic 'screen' functionality for a game.  In addition to the methods inherited from Canvas, this class also provides game-centric features such the ability to query the current state of the game keys and synchronous graphics flushing; these features simplify game development and improve performance. LayerThe Layer class represents a visual element in a game such as a Sprite or a TiledLayer.  This abstract class forms the basis for the Layer framework and provides basic attributes such as location, size, and visibility. LayerManagerFor games that employ several Layers, the LayerManager simplifies game development by automating the rendering process.  It allows the developer set a view window that represents the user's view of the game.  The LayerManager automatically renders the game's Layers to implement the desired view. SpriteA Sprite is basic animated Layer that can display one of several graphical frames.  The frames are all of equal size and are provided by a single Image object.  In addition to animating the frames sequentially, a custom sequence can also be set to animation the frames in an arbitrary manner.  The Sprite class also provides various transformations (flip and rotation) and collision detection methods that simplify the implementation of a game's logic. TiledLayerThis class enables a developer to create large areas of graphical content without the resource usage that a large Image object would require.  It is a comprised of a grid of cells, and each cell can display one of several tiles that are provided by a single Image object.  Cells can also be filled with animated tiles whose corresponding pixel data can be changed very rapidly; this feature is very useful for animating large groups of cells such as areas of water.

本文地址:http://com.8s8s.com/it/it13090.htm