| Package | com.whirled.contrib.card.graphics |
| Class | public class HandSprite |
| Inheritance | HandSprite CardArraySprite flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
| _added : Array | HandSprite | ||
![]() | _animations : Array | CardArraySprite | |
![]() | _cards : Array | CardArraySprite | |
![]() | _factory : CardSpriteFactory | CardArraySprite | |
| _floater : CardSprite | HandSprite | ||
| _hand : Hand | HandSprite | ||
| _removedCards : Array | HandSprite | ||
| _selectCount : int | HandSprite | ||
| _selected : Array | HandSprite | ||
![]() | _target : CardArray | CardArraySprite | |
| _userPreselect : Boolean | HandSprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
Create a new hand sprite.
| HandSprite | ||
|
finalizeRemovals():Array
Grab the card sprites that were recently removed from the hand.
| HandSprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
animateAddition(card:CardSprite):void
| HandSprite | ||
|
animateRemoval(card:CardSprite):void
| HandSprite | ||
|
cardArrayListener(event:CardArrayEvent):void
| HandSprite | ||
|
clickListener(event:MouseEvent):void
| HandSprite | ||
|
deselect(card:CardSprite):void
| HandSprite | ||
|
disable():void
Disable clicking on all cards.
| HandSprite | ||
|
dispatchSelection():void
| HandSprite | ||
|
Enable clicking on specific cards.
| HandSprite | ||
|
findCard(event:MouseEvent):CardSprite
| HandSprite | ||
|
findCardByLocalXY(x:int, y:int):CardSprite
| HandSprite | ||
|
findCardByX(xpos:int):CardSprite
| HandSprite | ||
|
floatCard(card:CardSprite):void
Slide a card vertically to indicate that clicking it will play it.
| HandSprite | ||
![]() |
getStaticCardPosition(i:int, pos:Point):void
Get the x, y position of a card in the array.
| CardArraySprite | |
|
handListener(event:HandEvent):void
| HandSprite | ||
|
isSelected(card:CardSprite):Boolean
| HandSprite | ||
![]() |
positionCards():void
Positions all cards (that are not currently animating).
| CardArraySprite | |
![]() |
refresh():void
Update our card sprites with the contents of the target card array.
| CardArraySprite | |
|
select(card:CardSprite, userAction:Boolean):void
| HandSprite | ||
|
unfloatCard():void
Slide the currently floating card back into its usual location.
| HandSprite | ||
|
updateFloater(event:MouseEvent):void
| HandSprite | ||
|
verticalTween(card:CardSprite, offset:int):void
| HandSprite | ||
| Constant | Defined by | ||
|---|---|---|---|
| FLOAT_DURATION : Number = .2 [static]
| HandSprite | ||
| FLOAT_HEIGHT : Number = 10 [static]
| HandSprite | ||
| MAX_HAND_SIZE : int = 15 [static]
| HandSprite | ||
| REMOVAL_DURATION : Number = .75 [static]
| HandSprite | ||
| SELECT_HEIGHT : Number = 20 [static]
| HandSprite | ||
| SQUEEZE_DURATION : Number = .75 [static]
| HandSprite | ||
| _added | property |
protected var _added:Array
| _floater | property |
protected var _floater:CardSprite
| _hand | property |
protected var _hand:Hand
| _removedCards | property |
protected var _removedCards:Array
| _selectCount | property |
protected var _selectCount:int
| _selected | property |
protected var _selected:Array
| _userPreselect | property |
protected var _userPreselect:Boolean
| HandSprite | () | constructor |
public function HandSprite(hand:Hand, factory:CardSpriteFactory)Create a new hand sprite.
Parametershand:Hand — the card array this sprite represents
|
|
factory:CardSpriteFactory — the embedded deck object to use when creating instances of CardSprite
|
| animateAddition | () | method |
| animateRemoval | () | method |
| cardArrayListener | () | method |
protected override function cardArrayListener(event:CardArrayEvent):voidParameters
event:CardArrayEvent |
| clickListener | () | method |
protected function clickListener(event:MouseEvent):voidParameters
event:MouseEvent |
| deselect | () | method |
| disable | () | method |
protected function disable():voidDisable clicking on all cards.
| dispatchSelection | () | method |
protected function dispatchSelection():void
| enable | () | method |
protected function enable(subset:CardArray = null):voidEnable clicking on specific cards.
Parameterssubset:CardArray (default = null) — the cards to enable, or all if null (default)
|
— is the resulting set of enabled cards is empty since otherwise
the game will be waiting forever. |
| finalizeRemovals | () | method |
public function finalizeRemovals():ArrayGrab the card sprites that were recently removed from the hand. After each card is removed, its sprite is animated towards a central location and added to an array. It is expected that the TrickSprite or some other card game view object will call this function to take control of the removed cards. Card sprites accessed from this function will be free of positional tweens and removed from the parent container (this).
ReturnsArray — an Array of CardSprite objects. |
| findCard | () | method |
protected function findCard(event:MouseEvent):CardSpriteParameters
event:MouseEvent |
CardSprite |
| findCardByLocalXY | () | method |
protected function findCardByLocalXY(x:int, y:int):CardSpriteParameters
x:int |
|
y:int |
CardSprite |
| findCardByX | () | method |
| floatCard | () | method |
protected function floatCard(card:CardSprite):voidSlide a card vertically to indicate that clicking it will play it.
Parameterscard:CardSprite — the mouse position in the card's coordinates. |
| handListener | () | method |
| isSelected | () | method |
| select | () | method |
protected function select(card:CardSprite, userAction:Boolean):voidParameters
card:CardSprite |
|
userAction:Boolean |
| unfloatCard | () | method |
protected function unfloatCard():voidSlide the currently floating card back into its usual location.
| updateFloater | () | method |
protected function updateFloater(event:MouseEvent):voidParameters
event:MouseEvent |
| verticalTween | () | method |
protected function verticalTween(card:CardSprite, offset:int):voidParameters
card:CardSprite |
|
offset:int |
| FLOAT_DURATION | constant |
protected static const FLOAT_DURATION:Number = .2
| FLOAT_HEIGHT | constant |
protected static const FLOAT_HEIGHT:Number = 10
| MAX_HAND_SIZE | constant |
protected static const MAX_HAND_SIZE:int = 15
| REMOVAL_DURATION | constant |
protected static const REMOVAL_DURATION:Number = .75
| SELECT_HEIGHT | constant |
protected static const SELECT_HEIGHT:Number = 20
| SQUEEZE_DURATION | constant |
protected static const SQUEEZE_DURATION:Number = .75