public class CardSprite
extends com.threerings.media.sprite.FadableImageSprite
DEFAULT_FRAME_RATE, MOVEMENT_CUED, NO_ANIMATION, TIME_BASED, TIME_SEQUENTIALCARDINAL_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 |
|---|
CardSprite(CardPanel panel,
Card card)
Creates a new upward-facing card sprite.
|
CardSprite(CardPanel panel,
Card card,
boolean facingUp)
Creates a new card sprite.
|
| Modifier and Type | Method and Description |
|---|---|
void |
flip(Card newCard,
long duration)
Flip the card from its current displayed card to the specified card.
|
Card |
getCard()
Returns the card being depicted.
|
boolean |
isDraggable()
Checks whether or not the user can drag this card.
|
boolean |
isFacingUp()
Checks whether this card is facing up or down.
|
void |
paint(Graphics2D gfx) |
void |
setCard(Card card)
Sets the card to depict.
|
void |
setDraggable(boolean draggable)
Sets whether or not the user can drag this card around the board.
|
void |
setFacingUp(boolean facingUp)
Turns this card up or down.
|
void |
tick(long tickStamp) |
fadeIn, fadeOut, getAlpha, moveAndFadeIn, moveAndFadeInAndOut, moveAndFadeOut, pathCompleted, setAlphahitTest, layout, setAnimationMode, setFrameRate, setFrames, setMirageaddSpriteObserver, cancelMove, contains, fastForward, getHeight, getOrientation, getPath, getWidth, getX, getXOffset, getY, getYOffset, inside, intersects, isMoving, move, paintPath, pathBeginning, removeSpriteObserver, setLocation, viewLocationDidChangecontains, contains, contains, contains, getBounds, getBounds2D, getPathIterator, getPathIterator, getRenderOrder, init, intersects, intersects, invalidate, queueNotification, renderCompareTo, setRenderOrder, toStringpublic CardSprite(CardPanel panel, Card card)
panel - the panel responsible for the spritecard - the card to depict (can be null, in which case the
card back will be shown)public void setCard(Card card)
card - the new cardpublic Card getCard()
public void setFacingUp(boolean facingUp)
facingUp - whether or not the card should be facing uppublic boolean isFacingUp()
public void setDraggable(boolean draggable)
draggable - whether or not the user can drag the cardpublic boolean isDraggable()
public void flip(Card newCard, long duration)
public void tick(long tickStamp)
tick in class com.threerings.media.sprite.FadableImageSpritepublic void paint(Graphics2D gfx)
paint in class com.threerings.media.sprite.FadableImageSpriteCopyright © 2015. All rights reserved.