| Package | com.whirled.contrib.card.graphics |
| Class | public class CardArraySprite |
| Inheritance | CardArraySprite flash.display.Sprite |
| Subclasses | HandSprite, TrickSprite |
| Property | Defined by | ||
|---|---|---|---|
| factory : CardSpriteFactory
[read-only] Access the factory for card creation and layout.
| CardArraySprite | ||
| Property | Defined by | ||
|---|---|---|---|
| _animations : Array | CardArraySprite | ||
| _cards : Array | CardArraySprite | ||
| _factory : CardSpriteFactory | CardArraySprite | ||
| _target : CardArray | CardArraySprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
Create a new sprite for a CardArray.
| CardArraySprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
animateAddition(card:CardSprite):void
Animates the addition of the card.
| CardArraySprite | ||
|
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(i:int, pos:Point):void
Get the x, y position of a card in the array.
| CardArraySprite | ||
|
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 | ||
| _animations | property |
protected var _animations:Array
| _cards | property |
protected var _cards:Array
| _factory | property |
protected var _factory:CardSpriteFactory
| factory | property |
factory:CardSpriteFactory [read-only]Access the factory for card creation and layout.
Implementation public function get factory():CardSpriteFactory
| _target | property |
protected var _target:CardArray
| CardArraySprite | () | constructor |
public function CardArraySprite(target:CardArray, factory:CardSpriteFactory, doPositioning:Boolean = true)Create a new sprite for a CardArray. The sprite will always listen for all changes on the array events and unregister when removed from the display list. Re-adding to the display list is not supported.
Parameterstarget:CardArray — the CardArray to listen to for changes to the sprite
|
|
factory:CardSpriteFactory — the embedded deck object to use when creating CardSprite instances
|
|
doPositioning:Boolean (default = true) — specify whether to call positionCards |
| animateAddition | () | method |
protected function animateAddition(card:CardSprite):voidAnimates the addition of the card. Default does nothing. Subclasses should set the starting position of the card and use slide to move it into its static position.
Parameterscard:CardSprite |
| animateRemoval | () | method |
protected function animateRemoval(card:CardSprite):voidAnimates the removal of a card. The _cards array will be taken care of, this function must only guarantee that removeChild is called later. By default, just calls removeChild immediately.
Parameterscard:CardSprite |
| cardArrayListener | () | method |
protected function cardArrayListener(event:CardArrayEvent):voidWhen the card array changes, update our child sprites and re-layout.
Parametersevent:CardArrayEvent |
| getStaticCardPosition | () | method |
protected function getStaticCardPosition(i:int, pos:Point):voidGet the x, y position of a card in the array. The base implmentation just lays out the cards in a row using some hard-wired constants for width and height. Subclasses should override and use more specific values.
Parametersi:int |
|
pos:Point |
| positionCards | () | method |
protected function positionCards():voidPositions all cards (that are not currently animating).
| refresh | () | method |
protected function refresh():voidUpdate our card sprites with the contents of the target card array.