Using Sprites; Defining View Windows; Playfield Constructor - Motorola C370 Series Technical Manual

J2me developer guide
Hide thumbs Also See for C370 Series:
Table of Contents

Advertisement

8
Gaming API and Sound
calling
setAnimatedTileImage(-2, 2);
with the image of static Tile 2.

Using Sprites

In addition to being a grid of cells, a
(see 0 item). When the
Therefore,
are drawn first. Then all cells in the grid are drawn. Then all the
(Sprite.getDepth() >= 0) are drawn. The
their location and visibility status as defined in the
Sprites

Defining View Windows

A view window onto the
setViewWindow(). This defines the area of the
the draw() method. The default viewing window onto a
time) is the entire area of the

PlayField Constructor

The
PlayField
PlayField (int columns, int rows, Image img, int tWidth, int tHeight) throws
NullPointerException, IllegalArgumentException - Creates a new PlayField with a tile
set. The parameter are the following
It creates a new
tile set for the PlayField will be created from subsections of the image passed in. The
PlayField
represents an empty square) and laying out tiles must be accomplished through the
use of other methods in the class. The creation of the static tile set follows these
standards:
Tiles must be equally sized, all being of the tile width (
(
tHeight
horizontally, vertically, or as a grid. The width of the source image must be an integer
PlayField
below the grid (
Sprites
is relative to the top-left corner of the
PlayField
PlayField
class defines the following constructors:
- width of the PlayField in number of cells;
columns
- height of the PlayField in number of cells;
rows
- Image to use for creating tiles;
img
- width, in pixels, of the individual tiles;
tWidth
- height, in pixels, of the individual tiles.
tHeight
PlayField
grid is initially filled with empty cells (tile 0 - a reserved tile and
) defined in the constructor parameters. They may be laid out in the image
, cells (0,0) and (0,1) will then be drawn
can have a set of associated
Playfield
is drawn, the grid is considered to have depth 0.
with Sprite.getDepth() < 0)
Sprites
Sprites
class. The location of
Sprite
PlayField
can be defined using the method
PlayField
PlayField
.
:
,
cells high and
rows
columns
tWidth
Sprites
above the grid
Sprites
are drawn according to
.
that will be drawn by
(at construction
cells wide. The static
) and height
49

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents