|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.lcdui.game.Layer | +--javax.microedition.lcdui.game.Sprite | +--mgdk.MSprite | +--mgdk.M8Sprite
Used to display a sprite that has frames for eight different directions (N, NE, E, SE, S, SW, W, NW).
Field Summary | |
static int |
EAST
|
static int |
NE
Facing down (South). |
static int |
NORTH
Facing up (North). |
static int |
NW
|
static int |
SE
|
static int |
SOUTH
|
static int |
SW
|
static int |
WEST
|
Fields inherited from class mgdk.MSprite |
vx, vy |
Fields inherited from class javax.microedition.lcdui.game.Sprite |
TRANS_MIRROR, TRANS_MIRROR_ROT180, TRANS_MIRROR_ROT270, TRANS_MIRROR_ROT90, TRANS_NONE, TRANS_ROT180, TRANS_ROT270, TRANS_ROT90 |
Constructor Summary | |
M8Sprite(java.lang.String filename,
int frameWidth,
int frameHeight,
int dirFrames)
Constructs a M8Sprite and initilizes the data. |
Method Summary | |
int |
getDirection()
Get the direction drawn for this sprite. |
int |
getDirFrames()
Returns number of frames used for each direction. |
void |
setDirection(int dir)
Sets the direction which the Sprite is facing. |
void |
setDirectionFromKeys(MCanvas c)
Sets the direction depending on which keys are pressed. |
Methods inherited from class mgdk.MSprite |
activateAnimset, createAnimsets, detailedCollidesWith, getAnimsetNum, move, nextFrame, setAnimDelay, setAnimset, setVelocity, setX, setY |
Methods inherited from class javax.microedition.lcdui.game.Sprite |
collidesWith, collidesWith, collidesWith, defineCollisionRectangle, defineReferencePixel, getFrame, getFrameSequenceLength, getRawFrameCount, getRefPixelX, getRefPixelY, paint, prevFrame, setFrame, setFrameSequence, setImage, setRefPixelPosition, setTransform |
Methods inherited from class javax.microedition.lcdui.game.Layer |
getHeight, getWidth, getX, getY, isVisible, move, setPosition, setVisible |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int NORTH
public static final int NE
public static final int EAST
public static final int SE
public static final int SOUTH
public static final int SW
public static final int WEST
public static final int NW
Constructor Detail |
public M8Sprite(java.lang.String filename, int frameWidth, int frameHeight, int dirFrames)
dirFrames
- number of frames for each direction.Method Detail |
public void setDirection(int dir)
dir
- one of the direction constants.public void setDirectionFromKeys(MCanvas c)
public int getDirection()
public int getDirFrames()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |