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

javax.microedition.lcdui.game
Classes 
GameCanvas
Layer
LayerManager
Sprite
TiledLayer

API Overview

The API is comprised of five classes:

GameCanvas

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

Layer

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

LayerManager

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

Sprite

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

TiledLayer

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

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值