Packagecom.whirled.contrib.card.graphics
Classpublic class PlayerSprite
InheritancePlayerSprite Inheritance flash.display.Sprite

Flash object for a player sitting at a trick-taking card game. This is a placeholder for something nicer, so only the interface is documented in detail.



Protected Properties
 PropertyDefined by
  _background : Bitmap
PlayerSprite
  _caption : Text
PlayerSprite
  _captionColor : uint
PlayerSprite
  _captionOutlineColor : uint
PlayerSprite
  _headShot : HeadShotContainer
PlayerSprite
  _height : int
PlayerSprite
  _id : int
PlayerSprite
  _team : Team
PlayerSprite
  _timer : TimerMovie
PlayerSprite
  _turn : Boolean
PlayerSprite
  _warningColor : uint
PlayerSprite
Public Methods
 MethodDefined by
  
PlayerSprite(table:Table, id:int, width:int, height:int, timer:TurnTimer, timerMovie:Class, timerPos:Point, background:Class, textColor:uint, outlineColor:uint, warningColor:uint, captionColor:uint, captionOutlineColor:uint)
Create a new player.
PlayerSprite
  
setHeadShot(headShot:DisplayObject):void
Set the player head shot.
PlayerSprite
  
setTurn(turn:Boolean):void
Update to reflect the turn status.
PlayerSprite
  
showCaption(str:String, warning:Boolean = false):void
Display a warning for this player.
PlayerSprite
Protected Methods
 MethodDefined by
  
PlayerSprite
Protected Constants
 ConstantDefined by
  DROP_SHADOW_MAX_ALPHA : Number = 0.5
[static]
PlayerSprite
Property detail
_backgroundproperty
protected var _background:Bitmap
_captionproperty 
protected var _caption:Text
_captionColorproperty 
protected var _captionColor:uint
_captionOutlineColorproperty 
protected var _captionOutlineColor:uint
_headShotproperty 
protected var _headShot:HeadShotContainer
_heightproperty 
protected var _height:int
_idproperty 
protected var _id:int
_teamproperty 
protected var _team:Team
_timerproperty 
protected var _timer:TimerMovie
_turnproperty 
protected var _turn:Boolean
_warningColorproperty 
protected var _warningColor:uint
Constructor detail
PlayerSprite()constructor
public function PlayerSprite(table:Table, id:int, width:int, height:int, timer:TurnTimer, timerMovie:Class, timerPos:Point, background:Class, textColor:uint, outlineColor:uint, warningColor:uint, captionColor:uint, captionOutlineColor:uint)

Create a new player.

Parameters
table:Table — the table for the game the player is playing
 
id:int — the id of the player this sprite represents
 
width:int — the turn timer model object
 
height:int — the embedded movie for the turn timer
 
timer:TurnTimer — the position of the timer relative to the center of the player sprite
 
timerMovie:Class — the embedded background object
 
timerPos:Point — the color of the text of the player's name
 
background:Class — the color of the outline of the text
 
textColor:uint — the width of the background image
 
outlineColor:uint — the height of the background image
 
warningColor:uint — the color of the caption text when it is a warning
 
captionColor:uint — the color of the caption text normally
 
captionOutlineColor:uint — the color of the outline of the caption text
Method detail
setHeadShot()method
public function setHeadShot(headShot:DisplayObject):void

Set the player head shot.

Parameters
headShot:DisplayObject
setTurn()method 
public function setTurn(turn:Boolean):void

Update to reflect the turn status.

Parameters
turn:Boolean — indicates whether it is this player's turn
showCaption()method 
public function showCaption(str:String, warning:Boolean = false):void

Display a warning for this player. TODO: make protected and listen for warning events in subclasses.

Parameters
str:String
 
warning:Boolean (default = false)
turnTimerListener()method 
protected function turnTimerListener(event:TurnTimerEvent):voidParameters
event:TurnTimerEvent
Constant detail
DROP_SHADOW_MAX_ALPHAconstant
protected static const DROP_SHADOW_MAX_ALPHA:Number = 0.5