Packageorg.wak.gui.modern
Classpublic class ModernInventoryDisplay
InheritanceModernInventoryDisplay Inheritance flash.display.Sprite

Class to render the player's inventory in the modern gui.



Public Properties
 PropertyDefined by
  arrowLeft : WakSimpleButton
[write-only] Button to scroll left the inventory.
ModernInventoryDisplay
  arrowRight : WakSimpleButton
[write-only] Button to scroll right the inventory.
ModernInventoryDisplay
  background : DisplayObject
[write-only]
ModernInventoryDisplay
  itemSeparatorSpace : Number
[write-only]
ModernInventoryDisplay
  itemsY : Number
[write-only]
ModernInventoryDisplay
Protected Properties
 PropertyDefined by
  mArrowLeft : WakSimpleButton = null
ModernInventoryDisplay
  mArrowRight : WakSimpleButton = null
ModernInventoryDisplay
  mBackground : DisplayObject = null
ModernInventoryDisplay
  mCols : int = 0
ModernInventoryDisplay
  mColsSeparator : int = 1
ModernInventoryDisplay
  mInventory : Inventory = null
ModernInventoryDisplay
  mInventoryMask : Sprite = null
ModernInventoryDisplay
  mItemHeight : int = 0
ModernInventoryDisplay
  mItemsArray : Array = null
ModernInventoryDisplay
  mItemsX : Number = 0
ModernInventoryDisplay
  mItemsY : Number = 0
ModernInventoryDisplay
  mItemWidth : int = 0
ModernInventoryDisplay
  mRows : int = 0
ModernInventoryDisplay
  mScrollingLayer : Sprite = null
ModernInventoryDisplay
  mScrollingLayerDest : Number = 0
ModernInventoryDisplay
  mScrollingLayerIsMoving : Boolean = false
ModernInventoryDisplay
  mSelectedItem : Sprite = null
ModernInventoryDisplay
  mSpriteToItem : Array = null
ModernInventoryDisplay
  mTotalRows : int = 0
ModernInventoryDisplay
Public Methods
 MethodDefined by
  
ModernInventoryDisplay(pInventory:Inventory, pCols:int = 4, pItemWidth:int = 70, pItemHeight:int = 44)
Constructor
ModernInventoryDisplay
Protected Methods
 MethodDefined by
  
ModernInventoryDisplay
  
ModernInventoryDisplay
  
DrawLeftArrow(pBgColor:uint, pArrowColor:uint):Sprite
ModernInventoryDisplay
  
FillInventory(pItItems:IIterator):void
ModernInventoryDisplay
  
GetItemDisplayInCol(pCol:int):DisplayObject
ModernInventoryDisplay
  
OnAddedToStage(event:Event):void
ModernInventoryDisplay
  
ModernInventoryDisplay
  
OnItemMouseClick(event:MouseEvent):void
ModernInventoryDisplay
  
OnItemMouseOut(event:MouseEvent):void
ModernInventoryDisplay
  
OnItemMouseOver(event:MouseEvent):void
ModernInventoryDisplay
  
ModernInventoryDisplay
  
OnRemovedToStage(event:Event):void
ModernInventoryDisplay
  
ModernInventoryDisplay
  
OnScrollLeft(event:Event):void
ModernInventoryDisplay
  
OnScrollRight(event:Event):void
ModernInventoryDisplay
  
RefreshItemsPositions(pItemsArray:Array):void
ModernInventoryDisplay
  
ScrollLeft():void
ModernInventoryDisplay
  
ScrollRight():void
ModernInventoryDisplay
  
ScrollRightCols(pNum:int):void
ModernInventoryDisplay
  
UpdateScrollButtons(pDirection:Number):void
ModernInventoryDisplay
Property detail
arrowLeftproperty
arrowLeft:WakSimpleButton  [write-only]

Button to scroll left the inventory.

Implementation
    public function set arrowLeft(value:WakSimpleButton):void
arrowRightproperty 
arrowRight:WakSimpleButton  [write-only]

Button to scroll right the inventory.

Implementation
    public function set arrowRight(value:WakSimpleButton):void
backgroundproperty 
background:DisplayObject  [write-only]Implementation
    public function set background(value:DisplayObject):void
itemSeparatorSpaceproperty 
itemSeparatorSpace:Number  [write-only]Implementation
    public function set itemSeparatorSpace(value:Number):void
itemsYproperty 
itemsY:Number  [write-only]Implementation
    public function set itemsY(value:Number):void
mArrowLeftproperty 
protected var mArrowLeft:WakSimpleButton = null
mArrowRightproperty 
protected var mArrowRight:WakSimpleButton = null
mBackgroundproperty 
protected var mBackground:DisplayObject = null
mColsproperty 
protected var mCols:int = 0
mColsSeparatorproperty 
protected var mColsSeparator:int = 1
mInventoryproperty 
protected var mInventory:Inventory = null
mInventoryMaskproperty 
protected var mInventoryMask:Sprite = null
mItemHeightproperty 
protected var mItemHeight:int = 0
mItemsArrayproperty 
protected var mItemsArray:Array = null
mItemsXproperty 
protected var mItemsX:Number = 0
mItemsYproperty 
protected var mItemsY:Number = 0
mItemWidthproperty 
protected var mItemWidth:int = 0
mRowsproperty 
protected var mRows:int = 0
mScrollingLayerproperty 
protected var mScrollingLayer:Sprite = null
mScrollingLayerDestproperty 
protected var mScrollingLayerDest:Number = 0
mScrollingLayerIsMovingproperty 
protected var mScrollingLayerIsMoving:Boolean = false
mSelectedItemproperty 
protected var mSelectedItem:Sprite = null
mSpriteToItemproperty 
protected var mSpriteToItem:Array = null
mTotalRowsproperty 
protected var mTotalRows:int = 0
Constructor detail
ModernInventoryDisplay()constructor
public function ModernInventoryDisplay(pInventory:Inventory, pCols:int = 4, pItemWidth:int = 70, pItemHeight:int = 44)

Constructor

Parameters
pInventory:Inventory — the inventory of the player's character
 
pCols:int (default = 4) — visible columns that the inventory will have on screen.
 
pItemWidth:int (default = 70) — max width in pixels of an item on the inventory
 
pItemHeight:int (default = 44) — max height in pixels of an item on the inventory
Method detail
CreateDownArrow()method
protected function CreateDownArrow():WakSimpleButton

Returns
WakSimpleButton
CreateRightArrow()method 
protected function CreateRightArrow():WakSimpleButton

Returns
WakSimpleButton
DrawLeftArrow()method 
protected function DrawLeftArrow(pBgColor:uint, pArrowColor:uint):SpriteParameters
pBgColor:uint
 
pArrowColor:uint

Returns
Sprite
FillInventory()method 
protected function FillInventory(pItItems:IIterator):voidParameters
pItItems:IIterator
GetItemDisplayInCol()method 
protected function GetItemDisplayInCol(pCol:int):DisplayObjectParameters
pCol:int

Returns
DisplayObject
OnAddedToStage()method 
protected function OnAddedToStage(event:Event):voidParameters
event:Event
OnItemAdded()method 
protected function OnItemAdded(event:InventoryEvent):voidParameters
event:InventoryEvent
OnItemMouseClick()method 
protected function OnItemMouseClick(event:MouseEvent):voidParameters
event:MouseEvent
OnItemMouseOut()method 
protected function OnItemMouseOut(event:MouseEvent):voidParameters
event:MouseEvent
OnItemMouseOver()method 
protected function OnItemMouseOver(event:MouseEvent):voidParameters
event:MouseEvent
OnItemRemoved()method 
protected function OnItemRemoved(event:InventoryEvent):voidParameters
event:InventoryEvent
OnRemovedToStage()method 
protected function OnRemovedToStage(event:Event):voidParameters
event:Event
OnScrollCompleted()method 
protected function OnScrollCompleted():void
OnScrollLeft()method 
protected function OnScrollLeft(event:Event):voidParameters
event:Event
OnScrollRight()method 
protected function OnScrollRight(event:Event):voidParameters
event:Event
RefreshItemsPositions()method 
protected function RefreshItemsPositions(pItemsArray:Array):voidParameters
pItemsArray:Array
ScrollLeft()method 
protected function ScrollLeft():void
ScrollRight()method 
protected function ScrollRight():void
ScrollRightCols()method 
protected function ScrollRightCols(pNum:int):voidParameters
pNum:int
UpdateScrollButtons()method 
protected function UpdateScrollButtons(pDirection:Number):voidParameters
pDirection:Number