| Package | com.whirled.contrib.card.graphics |
| Class | public class TeamSprite |
| Inheritance | TeamSprite flash.display.Sprite |
| Property | Defined by | ||
|---|---|---|---|
| _bids : Bids
The bids for the game
| TeamSprite | ||
| _lastTrick : LastTrickSprite
Sprite for the last trick display
| TeamSprite | ||
| _lastTrickPos : Point Static position of our last trick display
| TeamSprite | ||
| _score : ScoreBar Score score, e.g.
| TeamSprite | ||
| _scores : Scores
The scores for the game
| TeamSprite | ||
| _table : Table
The table we are sitting at
| TeamSprite | ||
| _team : Team
The seats of our team members
| TeamSprite | ||
| _tricks : ScoreBar Tricks score, e.g.
| TeamSprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
TeamSprite(scores:Scores, team:int, height:int, lastTrickPos:Point, background:Class, nameTextColor:uint, nameTextOutlineColor:uint, scoreTextColor:uint, scoreTextOutlineColor:uint, labelTextColor:uint, labelTextOutlineColor:uint)
Create a new team sprite.
| TeamSprite | ||
|
clearLastTrick():void
Clear the card sprites.
| TeamSprite | ||
|
takeTrick(cards:Array, mainTrickPos:Point, winnerPos:Point):void
Take the array of card sprites and animate them to this team's last trick slot.
| TeamSprite | ||
| Method | Defined by | ||
|---|---|---|---|
|
bidListener(event:BidEvent):void
| TeamSprite | ||
|
makeNameString(name1:String, name2:String):String
[static] Utility function to truncate and concatenate two names.
| TeamSprite | ||
|
scoresListener(event:ScoresEvent):void
| TeamSprite | ||
|
setScore(current:int, target:int):void
Set the team's score display.
| TeamSprite | ||
|
updateTricks():void
Update the tricks/bid status text.
| TeamSprite | ||
| Constant | Defined by | ||
|---|---|---|---|
| FADE_DURATION : Number = .5 [static]
| TeamSprite | ||
| MAIN_TO_WINNER_DURATION : Number = 1.5 [static]
| TeamSprite | ||
| SLIDE_DELAY : Number = .5 [static]
| TeamSprite | ||
| TRICK_SCALE : Number = 0.5 [static]
| TeamSprite | ||
| _bids | property |
protected var _bids:BidsThe bids for the game
| _lastTrick | property |
protected var _lastTrick:LastTrickSpriteSprite for the last trick display
| _lastTrickPos | property |
protected var _lastTrickPos:PointStatic position of our last trick display
| _score | property |
protected var _score:ScoreBarScore score, e.g. "172/300"
| _scores | property |
protected var _scores:ScoresThe scores for the game
| _table | property |
protected var _table:TableThe table we are sitting at
| _team | property |
protected var _team:TeamThe seats of our team members
| _tricks | property |
protected var _tricks:ScoreBarTricks score, e.g. "1/5"
| TeamSprite | () | constructor |
public function TeamSprite(scores:Scores, team:int, height:int, lastTrickPos:Point, background:Class, nameTextColor:uint, nameTextOutlineColor:uint, scoreTextColor:uint, scoreTextOutlineColor:uint, labelTextColor:uint, labelTextOutlineColor:uint)Create a new team sprite. Long names will be truncated with an ellipsis.
Parametersscores:Scores — the scores object for the game. Also used to access the Table and Bids
|
|
team:int — the index of the team that this sprite is for
|
|
height:int — the relative position of the scaled down last trick icon
|
|
lastTrickPos:Point — the height of the background image, needed for layout
|
|
background:Class — the embedded class containing the background image
|
|
nameTextColor:uint — the color of the player names text
|
|
nameTextOutlineColor:uint — the color of the outline applied to the player names
|
|
scoreTextColor:uint — the color of the score (and trick) text
|
|
scoreTextOutlineColor:uint — the color of the score (and trick) text outline
|
|
labelTextColor:uint — the color of the score (and trick) label text
|
|
labelTextOutlineColor:uint — the color of the score (and trick) label text outline |
| bidListener | () | method |
| clearLastTrick | () | method |
public function clearLastTrick():voidClear the card sprites.
| makeNameString | () | method |
protected static function makeNameString(name1:String, name2:String):StringUtility function to truncate and concatenate two names.
Parametersname1:String |
|
name2:String |
String |
| scoresListener | () | method |
| setScore | () | method |
protected function setScore(current:int, target:int):voidSet the team's score display.
Parameterscurrent:int |
|
target:int |
| takeTrick | () | method |
public function takeTrick(cards:Array, mainTrickPos:Point, winnerPos:Point):voidTake the array of card sprites and animate them to this team's last trick slot. The animation includes x,y position and scale.
Parameterscards:Array — the trick just won
|
|
mainTrickPos:Point — the global coordinates of the position of the winning player |
|
winnerPos:Point |
| updateTricks | () | method |
protected function updateTricks():voidUpdate the tricks/bid status text.
| FADE_DURATION | constant |
protected static const FADE_DURATION:Number = .5
| MAIN_TO_WINNER_DURATION | constant |
protected static const MAIN_TO_WINNER_DURATION:Number = 1.5
| SLIDE_DELAY | constant |
protected static const SLIDE_DELAY:Number = .5
| TRICK_SCALE | constant |
protected static const TRICK_SCALE:Number = 0.5