|
||||||||||
| 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
com.threerings.puzzle.drop.client.DropBlockSprite
public class DropBlockSprite
The drop block sprite represents a block of multiple pieces that can be rotated to any of the four cardinal compass directions. As such, it may span multiple columns or rows depending on its orientation. The block has a "central" piece around which it rotates, with the other pieces referred to as "external" pieces.
| 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 | |
|---|---|
DropBlockSprite(DropBoardView view,
int col,
int row,
int orient,
int[] pieces)
Constructs a drop block sprite and starts it dropping. |
|
DropBlockSprite(DropBoardView view,
int col,
int row,
int orient,
int[] pieces,
int renderOrder)
Constructs a drop block sprite and starts it dropping. |
|
| Method Summary | |
|---|---|
boolean |
canPopup()
Can this sprite pop-up a row on a forgiving rotation? |
void |
didPopup()
Called if we pop up to decrement the remaining popups we have. |
Rectangle |
getBoardBounds()
Returns the bounds of the block in board piece coordinates. |
int[] |
getColumns()
Returns an array of the column numbers containing the block pieces. |
int |
getExternalColumn()
Returns the column the external piece is located in. |
int |
getExternalRow()
Returns the row the external piece is located in. |
int[] |
getRows()
Returns an array of the row numbers containing the block pieces. |
void |
setBoardLocation(int row,
int col)
Sets the row and column the piece is located in. |
void |
setColumn(int col)
Sets the column the piece is located in. |
void |
setOrientation(int orient)
Updates the sprite image offset to reflect the direction in which the external piece is hanging. |
void |
setRow(int row)
Set the row the piece is located in. |
void |
toString(StringBuilder buf)
|
| Methods inherited from class com.threerings.puzzle.drop.client.DropSprite |
|---|
drop, fastForward, getColumn, getDistance, getPercentDone, getPieces, getRow, getVelocity, inside, isBouncing, isDropping, paint, setBouncing, setColumnOffset, setPieces, setRowOffset, setVelocity, stop, tick |
| 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 DropBlockSprite(DropBoardView view,
int col,
int row,
int orient,
int[] pieces)
view - the board view upon which this sprite will be displayed.col - the column of the central piece.row - the row of the central piece.orient - the orientation of the sprite.pieces - the pieces displayed by the sprite.
public DropBlockSprite(DropBoardView view,
int col,
int row,
int orient,
int[] pieces,
int renderOrder)
view - the board view upon which this sprite will be displayed.col - the column of the central piece.row - the row of the central piece.orient - the orientation of the sprite.pieces - the pieces displayed by the sprite.renderOrder - the rendering order of the sprite.| Method Detail |
|---|
public int[] getRows()
public int[] getColumns()
public Rectangle getBoardBounds()
public int getExternalRow()
public int getExternalColumn()
public void setColumn(int col)
DropSprite
setColumn in class DropSpritepublic void setRow(int row)
DropSprite
setRow in class DropSprite
public void setBoardLocation(int row,
int col)
DropSprite
setBoardLocation in class DropSpritepublic void setOrientation(int orient)
setOrientation in interface com.threerings.media.util.PathablesetOrientation in class DropSpritepublic void toString(StringBuilder buf)
toString in class DropSpritepublic boolean canPopup()
public void didPopup()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||