Motorola C370 Series Technical Manual page 59

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

Advertisement

8
Gaming API and Sound
public void setVisible(boolean visible) – Set visibility
status. If
draw(Graphics)
public boolean isVisible() – Get visibility status. The method returns
boolean indicating whether the Sprite will be drawn by
public final void draw(Graphics g) throws
NullPointerException – Draw the Sprite. Draw current frame of Sprite to
Graphics instance g at location currently set in Sprite. Sprite will be drawn only if
isVisible()= true
public void setFrameSequence(int[] seq) throws
ArrayIndexOutOfBoundsException – Set the sequence of frames to
cycle through with next/prevFrame. All Sprites have a default sequence as described
in the constructor. This method allows for the creation of an arbitrary sequence from
the original frameset. The methods nextFrame(), prevFrame(), getFrame(), and
setFrame(int) all operate on the frame sequence. Passing in
sequence to revert to the default sequence defined in the constructor. The parameter
seq
original raw frameset, that is, the frames from left to right on the original image.
public int[] getFrameSequence() – Get the current frame
sequence. Returns the frame sequence set with
setFrameSequence(int[]) or, if none has been set, return the default
frame sequence for this Sprite. Each entry in the array is an index to the original raw
frameset, that is, the frame numbering as described in the constructor.
public void
setImage(javax.microedition.lcdui.Image img,
int fWidth, int fHeight) throws NullPointerException,
IllegalArgumentException – Change the image used for the Sprite.
Replaces the current raw frames of the Sprite with a new set of raw frames. See the
constructor Sprite(Image, int, int) for information on how the frames are created from
the image. Changing the image for the Sprite could change the number of raw
frames. If the new frame set has as many or more raw frames than the previous
frame set, then:
If the new frame set have less frames than the previous frame set, then:
setVisible(false)
until
setVisible(true)
.
is an array of integers, where each integer is a reference to a frame in the
The current frame will be unchanged;
If a custom frame sequence has been defined (using setFrameSequence(int[])),
it will remain unchanged. If no custom frame sequence is defined (i.e. the default
frame sequence is in use), the default frame sequence will be updated to be the
default frame sequence for the new frame set. In other words, the new default
frame sequence will include all of the frames from the new raw frame set, as if
this new image had been used in the constructor.
The current frame will be reset to frame 0;
is called, the Sprite will not be drawn by
is called.
draw(Graphics)
null
.
causes the
59

Advertisement

Table of Contents
loading

This manual is also suitable for:

C450 seriesC550 series

Table of Contents