public class DropSprite
extends com.threerings.media.sprite.Sprite
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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()
|
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) |
addSpriteObserver, cancelMove, contains, getHeight, getOrientation, getPath, getWidth, getX, getXOffset, getY, getYOffset, hitTest, intersects, isMoving, move, paintPath, pathBeginning, pathCompleted, removeSpriteObserver, setLocation, viewLocationDidChangecontains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, intersects, intersects, invalidate, queueNotification, renderCompareTo, setRenderOrder, toStringpublic 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.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()
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.SpriteCopyright © 2015. All rights reserved.