Motorola C370 Series Technical Manual page 58

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

Advertisement

public void setDepth(int d) – Set Sprite's depth order. The depth
order is relative to other Sprites when multiple Sprites are contained in a container
object, i.e. a PlayField. When Sprites are drawn explicitly instead of implicitly through
the use of a container object, the management of drawing order is the responsibility
of the developer. Integer.MIN_VALUE is the lowest depth, Integer.MAX_VALUE is
the highest depth. So items with depth Integer.MIN_VALUE would be drawn first, or
at the bottom, and items with depth Integer.MAX_VALUE would be drawn last or on
top.
public void move(int dx, int dy) – Move Sprite. The method
parameters are
- pixels to move Sprite along horizontal axis, and
dx
move Sprite along vertical axis.
public int getX() – Get Sprite's x position.
public int getY() – Get Sprite's y position.
public int getDepth() – Get Sprite's depth order.
public int getHeight() – Get Sprite's height order.
public int getWidth() – Get Sprite's width in pixels.
public boolean collidesWith(Sprite s,
boolean pixelLevel) throws NullPointerException – Check for
collision between two Sprites. If
rectangular areas of the two Sprites, using positions (x, y) and extents (width, height).
The two Sprites are treated as if they are in the same coordinate system. For
example, if the two Sprites are on different PlayFields that are drawn at different
locations, this method still behaves as if they are on the same PlayField. If
is true, check for overlap in opaque pixels of the two Sprites.
pixelLevel
Overlapping in transparent regions of either Sprite will not be considered a collision.
public void setFrame(int frame) – Set Sprite's animation frame.
Sets which frame from the frame sequence to draw when draw(Graphics) is called.
All Sprites have a default frame sequence as described in the constructor.
public int getFrame() – Get Sprite's current animation frame. All Sprites
have a default frame sequence as described in the constructor.
public int getNumRawFrames() – Get the number of raw frames in
the original frame set for this Sprite.
public void nextFrame() – Set current animation frame to the next
frame. Advance to next frame in the frame sequence. All Sprites have a default frame
sequence as described in the constructor. Frame list is considered to be circular, i.e.
if
is called when the last frame is the current frame, this will advance
nextFrame()
to the first frame.
public void prevFrame() – Set current animation frame to the previous
frame. Advance to previous frame in the frame sequence. All Sprites have a default
frame sequence as described in the constructor. Frame list is considered to be
circular, i.e. if
prevFrame()
will advance to the last frame.
is false, check for overlap in the
pixelLevel
is called when the first frame is the current frame, this
- pixels to
dy

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents