|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.threerings.media.AbstractMedia
com.threerings.media.sprite.Sprite
com.threerings.puzzle.drop.client.DropSprite
public class DropSprite
The drop sprite is a sprite that displays one or more pieces falling toward the bottom of the board.
| Field Summary |
|---|
| Fields inherited from class com.threerings.media.AbstractMedia |
|---|
HUD_LAYER |
| Fields inherited from interface com.threerings.util.DirectionCodes |
|---|
CARDINAL_DIRECTIONS, CCW, CW, DIRECTION_COUNT, DOWN, EAST, EASTNORTHEAST, EASTSOUTHEAST, FINE_DIRECTION_COUNT, HORIZONTAL, LEFT, NONE, NORTH, NORTHEAST, NORTHNORTHEAST, NORTHNORTHWEST, NORTHWEST, RIGHT, SOUTH, SOUTHEAST, SOUTHSOUTHEAST, SOUTHSOUTHWEST, SOUTHWEST, UP, VERTICAL, WEST, WESTNORTHWEST, WESTSOUTHWEST |
| Constructor Summary | |
|---|---|
DropSprite(DropBoardView view,
int col,
int row,
int[] pieces,
int dist)
Constructs a drop sprite and starts it dropping. |
|
DropSprite(DropBoardView view,
int col,
int row,
int[] pieces,
int dist,
int renderOrder)
Constructs a drop sprite and starts it dropping. |
|
| Method Summary | |
|---|---|
void |
drop()
Starts the piece dropping toward the next row. |
void |
fastForward(long timeDelta)
|
int |
getColumn()
Returns the column the piece is located in. |
int |
getDistance()
Returns the remaining number of columns to drop. |
float |
getPercentDone(long timestamp)
Returns a value between 0.0 and 1.0 representing how far the
piece has moved toward the next row as of the given time stamp. |
int[] |
getPieces()
Returns the pieces the sprite is displaying. |
int |
getRow()
Returns the row the piece is located in. |
float |
getVelocity()
Returns the velocity of this sprite. |
boolean |
inside(Shape shape)
|
boolean |
isBouncing()
Returns true if this sprite is bouncing. |
boolean |
isDropping()
Returns true if this drop sprite is dropping, false if it has been stop()ped or has
not yet been drop()ped. |
void |
paint(Graphics2D gfx)
|
void |
setBoardLocation(int row,
int col)
Sets the row and column the piece is located in. |
void |
setBouncing(boolean bouncing)
Puts the drop sprite into (or takes it out of) bouncing mode. |
void |
setColumn(int col)
Sets the column the piece is located in. |
void |
setColumnOffset(int count)
Sets the column offset of the sprite image. |
void |
setOrientation(int orient)
|
void |
setPieces(int[] pieces)
Sets the pieces the sprite is displaying. |
void |
setRow(int row)
Set the row the piece is located in. |
void |
setRowOffset(int count)
Sets the row offset of the sprite image. |
void |
setVelocity(float velocity)
Sets the velocity of this sprite. |
void |
stop()
Stops the piece from dropping. |
void |
tick(long timestamp)
|
void |
toString(StringBuilder buf)
|
| Methods inherited from class com.threerings.media.sprite.Sprite |
|---|
addSpriteObserver, cancelMove, contains, getHeight, getOrientation, getPath, getWidth, getX, getXOffset, getY, getYOffset, hitTest, intersects, isMoving, move, paintPath, pathBeginning, pathCompleted, removeSpriteObserver, setLocation, viewLocationDidChange |
| Methods inherited from class com.threerings.media.AbstractMedia |
|---|
contains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, intersects, intersects, invalidate, queueNotification, renderCompareTo, setRenderOrder, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface com.threerings.media.util.Pathable |
|---|
getBounds |
| Constructor Detail |
|---|
public DropSprite(DropBoardView view,
int col,
int row,
int[] pieces,
int dist)
view - the board view upon which this sprite will be displayed.col - the column of the sprite.row - the row of the bottom-most piece.pieces - the pieces displayed by the sprite.dist - the distance the sprite is to drop in rows.
public DropSprite(DropBoardView view,
int col,
int row,
int[] pieces,
int dist,
int renderOrder)
view - the board view upon which this sprite will be displayed.col - the column of the sprite.row - the row of the bottom-most piece.pieces - the pieces displayed by the sprite.dist - the distance the sprite is to drop in rows.renderOrder - the render order.| Method Detail |
|---|
public int getDistance()
public int getColumn()
public int getRow()
public int[] getPieces()
public float getVelocity()
public void setBoardLocation(int row,
int col)
public void setColumn(int col)
public void setRow(int row)
public void setColumnOffset(int count)
public void setRowOffset(int count)
public void setPieces(int[] pieces)
public void setVelocity(float velocity)
public void drop()
public boolean isDropping()
stop()ped or has
not yet been drop()ped.
public void stop()
public void setBouncing(boolean bouncing)
public boolean isBouncing()
public boolean inside(Shape shape)
inside in class com.threerings.media.sprite.Spritepublic float getPercentDone(long timestamp)
0.0 and 1.0 representing how far the
piece has moved toward the next row as of the given time stamp.
public void paint(Graphics2D gfx)
paint in class com.threerings.media.sprite.Spritepublic void tick(long timestamp)
tick in class com.threerings.media.sprite.Spritepublic void fastForward(long timeDelta)
fastForward in class com.threerings.media.sprite.Spritepublic void toString(StringBuilder buf)
toString in class com.threerings.media.sprite.Spritepublic void setOrientation(int orient)
setOrientation in interface com.threerings.media.util.PathablesetOrientation in class com.threerings.media.sprite.Sprite
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||