Motorola C370 Series Technical Manual page 52

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

Advertisement

source and destination cells overlap, the method shall behave as if the source cells
are first copied to a separate array, the source cells are cleared, and the tiles are
then copied back to the destination cells. The method parameters are the following:
- column of top-left destination cell;
dstCol
cell;
- column of top-left source cell;
srcCol
- width, in rows, of area of tiles to move; and
width
area of tiles to move.
public void fillCells(int col, int row, int width, int height, int tileIdx) throws
IndexOutOfBoundsException, ArrayIndexOutOfBoundsException – Fill each cell in a
rectangular area with a given animated or static tile. The method parameters are the
following:
- column of top-left cell;
col
rows, of area of cells to fill;
- index of tile to place in fill region.
tileIdx
public void
draw(javax.microedition.lcdui.Graphics g, int x,
int y) throws NullPointerException – Draw the PlayField to a
Graphics instance, anchoring the top left corner of the PlayField view window at the
position
on the Graphics instance. The method parameters are the
(x, y)
following:
- Graphics instance on which to draw the PlayField;
g
of the top left corner of the PlayField; and
the PlayField. The PlayField will be drawn as follows:
Draw all the Sprites with depth < 0 in increasing order of depth (depth -2 drawn
before or below depth -1);
Draw the tiles for all cells. Empty cells, those with Tile 0, are considered fully
transparent, so nothing is drawn for them.
Draw the all the Sprites with depth >= 0 in increasing order of depth (depth 1
drawn before or below depth 2). The location of the Sprites is defined by the
Sprite instance and is relative to the top left corner of the PlayField grid.
public int getCellWidth() – Get width of a cell, in pixels.
public int getCellHeight() – Get height of a cell, in pixels.
public int getGridWidth() – Get width of the PlayField grid, in cells.
public int getGridHeight() – Get height of the PlayField grid, in cells.
public boolean anyCollisions() – This method checks whether any
of the PlayField's Sprites collide with any of the PlayField's tiles or other Sprites on
the PlayField. It will return
any other Sprite. Like collidesWithSprites(Sprite) and collidesWithAnyTile(Sprite), this
method reports collisions only at a boundary level granularity, not pixel level
granularity.
public boolean collidesWithSprites(Sprite s) throws
NullPointerException – Check for Sprite collision with any other Sprites
on the PlayField. This method is complemented by Sprite.collidesWith(Sprite,
boolean); If collidesWithSprites(Sprite) returns true, the developer can find the exact
Sprite collision(s) by using Sprite.collidesWith(Sprite, boolean). This is similar to how
dstRow
srcRow
- row of top-left cell;
row
- height, in rows, of area of cells to fill; and
height
- the y coordinate of the top left corner of
y
if any Sprite on the PlayField collides with a tile or
true
- row of top-left destination
- row of top-left source cell;
- height, in rows, of
height
- width, in
width
- the x coordinate
x

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents