| Package | com.whirled.contrib.card.graphics |
| Class | public class MainTrickSprite |
| Inheritance | MainTrickSprite TrickSprite CardArraySprite flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
![]() | _animations : Array | CardArraySprite | |
![]() | _cards : Array | CardArraySprite | |
![]() | _factory : CardSpriteFactory | CardArraySprite | |
| _localHand : HandSprite | MainTrickSprite | ||
| _playerSprites : Array | MainTrickSprite | ||
![]() | _seating : Table | TrickSprite | |
![]() | _target : CardArray | CardArraySprite | |
![]() | _trick : Trick | TrickSprite | |
![]() | _winningCard : int = -1 | TrickSprite | |
![]() | winningCard : int Access the card that is currently winning, relative to the first card played this round.
| TrickSprite | |
| Method | Defined by | ||
|---|---|---|---|
|
Creates a new main trick sprite.
| MainTrickSprite | ||
|
orphanCards():Array
Remove all the card sprites and return an array containing them.
| MainTrickSprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
animateAddition(card:CardSprite):void
inheritDoc
| MainTrickSprite | ||
![]() |
animateRemoval(card:CardSprite):void
Animates the removal of a card.
| CardArraySprite | |
![]() |
cardArrayListener(event:CardArrayEvent):void
When the card array changes, update our child sprites and re-layout.
| CardArraySprite | |
![]() |
getStaticCardPosition(index:int, pos:Point):void
Use the static proportional positions and the current trick leader to place the cards in
a cross, mimicking the player positions at the table.
| TrickSprite | |
![]() |
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 | |
![]() |
trickListener(event:TrickEvent):void
| TrickSprite | |
| Constant | Defined by | ||
|---|---|---|---|
![]() | CARD_POSITIONS : Array [static]
| TrickSprite | |
| FLY_IN_DURATION : Number = .75 [static]
| MainTrickSprite | ||
| _localHand | property |
protected var _localHand:HandSprite
| _playerSprites | property |
protected var _playerSprites:Array
| MainTrickSprite | () | constructor |
public function MainTrickSprite(target:Trick, seating:Table, playerSprites:Array, localHand:HandSprite)Creates a new main trick sprite.
Parameterstarget:Trick — The trick that this sprite represents
|
|
seating:Table — An array of player sprite, relative to the local player
|
|
playerSprites:Array — The sprite representing the local player's hand |
|
localHand:HandSprite |
| animateAddition | () | method |
protected override function animateAddition(card:CardSprite):voidinheritDoc
Parameterscard:CardSprite |
| orphanCards | () | method |
public function orphanCards():ArrayRemove all the card sprites and return an array containing them. This should only be called if the underlying trick is about to be reset, i.e. on a CardArrayEvent.ACTION_PRERESET action. Otherwise a crash will occur. TODO: handle this using internal listener so caveat is not needed.
ReturnsArray |
| FLY_IN_DURATION | constant |
protected static const FLY_IN_DURATION:Number = .75