Packageorg.wak.gui.sci
Classpublic class SciInventoryDisplay
InheritanceSciInventoryDisplay Inheritance flash.display.Sprite

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



Public Properties
 PropertyDefined by
  arrowDown : WakSimpleButton
[write-only] Button to scroll down the inventory.
SciInventoryDisplay
  arrowUp : WakSimpleButton
[write-only] Button to scroll up the inventory.
SciInventoryDisplay
  buttonOk : WakSimpleButton
[write-only] Setter for the ok button of the inventory.
SciInventoryDisplay
  buttonSelect : WakSimpleButton
[write-only] Setter for the select arrow button of the inventory.
SciInventoryDisplay
  buttonsHorizontalSpace : Number
[write-only] The horizontal space between inventory's buttons.
SciInventoryDisplay
  dropShadow : Boolean
[write-only] Enable or disable the inventory's shadow.
SciInventoryDisplay
  firstItemX : Number
[write-only] Set the horizontal coordinate for the first item of the inventory
SciInventoryDisplay
  firstItemY : Number
[write-only] Set the verticall coordinate for the first item of the inventory
SciInventoryDisplay
  horizontalLayout : Boolean
[write-only] Use the horizontal layout for the row of buttons.
SciInventoryDisplay
  horizontalLayoutLeftMargin : Number
[write-only] The left margin for the horizontal layout.
SciInventoryDisplay
  horizontalLayoutY : Number
[write-only] The vertical coordinate of the row of buttons.
SciInventoryDisplay
  itemWasSelected : Boolean
[read-only] True if an item was selected on an inventory session (since the inventory was open).
SciInventoryDisplay
  mouseCursor : SciCursor
[write-only] Set the cursor used to show the selected items in the inventory.
SciInventoryDisplay
Protected Properties
 PropertyDefined by
  mArrowDown : WakSimpleButton = null
SciInventoryDisplay
  mArrowUp : WakSimpleButton = null
SciInventoryDisplay
  mBackground : DisplayObject = null
SciInventoryDisplay
  mBgColor : uint = 0xFFFFFF
SciInventoryDisplay
  mBgHeight : Number = 50
SciInventoryDisplay
  mBgWidth : Number = 50
SciInventoryDisplay
  mBorderColor : uint = 0x000000
SciInventoryDisplay
  mCols : int = 0
SciInventoryDisplay
  mColsSeparator : int = 1
SciInventoryDisplay
  mDrawnBg : Sprite = null
SciInventoryDisplay
  mInventory : Inventory = null
SciInventoryDisplay
  mInventoryMask : Sprite = null
SciInventoryDisplay
  mItemHeight : int = 0
SciInventoryDisplay
  mItemsArray : Array = null
SciInventoryDisplay
  mItemsX : Number = 0
SciInventoryDisplay
  mItemsY : Number = 0
SciInventoryDisplay
  mItemWidth : int = 0
SciInventoryDisplay
  mLastActionDispatched : String = ""
SciInventoryDisplay
  mRows : int = 0
SciInventoryDisplay
  mRowsSeparator : int = 2
SciInventoryDisplay
  mScrollingLayer : Sprite = null
SciInventoryDisplay
  mSelectedItem : Sprite = null
SciInventoryDisplay
  mShadowFilter : DropShadowFilter = null
SciInventoryDisplay
  mSpriteToItem : Array = null
SciInventoryDisplay
  mTotalRows : int = 0
SciInventoryDisplay
Public Methods
 MethodDefined by
  
SciInventoryDisplay(pInventory:Inventory, pActionsArr:Array, pRows:int = 2, pCols:int = 4, pItemWidth:int = 70, pItemHeight:int = 44, pBg:DisplayObject = null, pBgColor:uint = 0xFFFFFF, pBorderColor:uint = 0x000000, pW:Number = 200, pH:Number = 200)
Constructor
SciInventoryDisplay
  
SetActionsButtons(pBtnsArray:Array):void
Overrides the pActionsArr passed in the constructor with new actions and set the buttons for that actions.
SciInventoryDisplay
Protected Methods
 MethodDefined by
  
SciInventoryDisplay
  
CreateDefaultActionButtons(pActionsArr:Array):Array
SciInventoryDisplay
  
SciInventoryDisplay
  
SciInventoryDisplay
  
SciInventoryDisplay
  
SciInventoryDisplay
  
DispatchAction(pActionId:String, pItem:InventoryItem = null):void
SciInventoryDisplay
  
DrawDefaultButtonBg(pBtn:Sprite, pW:Number, pH:Number, pColor:uint):void
SciInventoryDisplay
  
DrawDownArrow(pBgColor:uint, pArrowColor:uint):Sprite
SciInventoryDisplay
  
DrawOkIcon(pBtn:Sprite):void
SciInventoryDisplay
  
FillInventory(pItItems:IIterator):void
SciInventoryDisplay
  
OnActionSelected(event:Event):void
SciInventoryDisplay
  
OnAddedToStage(event:Event):void
SciInventoryDisplay
  
OnButtonOkPressed(event:Event):void
SciInventoryDisplay
  
SciInventoryDisplay
  
OnItemMouseClick(event:MouseEvent):void
SciInventoryDisplay
  
OnItemMouseOut(event:MouseEvent):void
SciInventoryDisplay
  
OnItemMouseOver(event:MouseEvent):void
SciInventoryDisplay
  
SciInventoryDisplay
  
OnMouseMove(event:MouseEvent):void
SciInventoryDisplay
  
OnRemovedToStage(event:Event):void
SciInventoryDisplay
  
OnScrollDown(event:Event):void
SciInventoryDisplay
  
OnScrollUp(event:Event):void
SciInventoryDisplay
  
RefreshItemsPositions(pItemsArray:Array):void
SciInventoryDisplay
  
ScrollDown():void
SciInventoryDisplay
  
ScrollUp():void
SciInventoryDisplay
  
SciInventoryDisplay
Events
 EventSummaryDefined by
   Dispatched when an action button is clicked inside the inventory window.SciInventoryDisplay
   Dispatched when an inventory item button is selected in the inventory window.SciInventoryDisplay
Property detail
arrowDownproperty
arrowDown:WakSimpleButton  [write-only]

Button to scroll down the inventory.

Implementation
    public function set arrowDown(value:WakSimpleButton):void
arrowUpproperty 
arrowUp:WakSimpleButton  [write-only]

Button to scroll up the inventory.

Implementation
    public function set arrowUp(value:WakSimpleButton):void
buttonOkproperty 
buttonOk:WakSimpleButton  [write-only]

Setter for the ok button of the inventory.

Implementation
    public function set buttonOk(value:WakSimpleButton):void
buttonSelectproperty 
buttonSelect:WakSimpleButton  [write-only]

Setter for the select arrow button of the inventory.

Implementation
    public function set buttonSelect(value:WakSimpleButton):void
buttonsHorizontalSpaceproperty 
buttonsHorizontalSpace:Number  [write-only]

The horizontal space between inventory's buttons.

Implementation
    public function set buttonsHorizontalSpace(value:Number):void
dropShadowproperty 
dropShadow:Boolean  [write-only]

Enable or disable the inventory's shadow.

Implementation
    public function set dropShadow(value:Boolean):void
firstItemXproperty 
firstItemX:Number  [write-only]

Set the horizontal coordinate for the first item of the inventory

Implementation
    public function set firstItemX(value:Number):void
firstItemYproperty 
firstItemY:Number  [write-only]

Set the verticall coordinate for the first item of the inventory

Implementation
    public function set firstItemY(value:Number):void
horizontalLayoutproperty 
horizontalLayout:Boolean  [write-only]

Use the horizontal layout for the row of buttons.

Implementation
    public function set horizontalLayout(value:Boolean):void
horizontalLayoutLeftMarginproperty 
horizontalLayoutLeftMargin:Number  [write-only]

The left margin for the horizontal layout.

Implementation
    public function set horizontalLayoutLeftMargin(value:Number):void
horizontalLayoutYproperty 
horizontalLayoutY:Number  [write-only]

The vertical coordinate of the row of buttons.

Implementation
    public function set horizontalLayoutY(value:Number):void
itemWasSelectedproperty 
itemWasSelected:Boolean  [read-only]

True if an item was selected on an inventory session (since the inventory was open).

Implementation
    public function get itemWasSelected():Boolean
mArrowDownproperty 
protected var mArrowDown:WakSimpleButton = null
mArrowUpproperty 
protected var mArrowUp:WakSimpleButton = null
mBackgroundproperty 
protected var mBackground:DisplayObject = null
mBgColorproperty 
protected var mBgColor:uint = 0xFFFFFF
mBgHeightproperty 
protected var mBgHeight:Number = 50
mBgWidthproperty 
protected var mBgWidth:Number = 50
mBorderColorproperty 
protected var mBorderColor:uint = 0x000000
mColsproperty 
protected var mCols:int = 0
mColsSeparatorproperty 
protected var mColsSeparator:int = 1
mDrawnBgproperty 
protected var mDrawnBg:Sprite = null
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
mLastActionDispatchedproperty 
protected var mLastActionDispatched:String = ""
mouseCursorproperty 
mouseCursor:SciCursor  [write-only]

Set the cursor used to show the selected items in the inventory.

Implementation
    public function set mouseCursor(value:SciCursor):void
mRowsproperty 
protected var mRows:int = 0
mRowsSeparatorproperty 
protected var mRowsSeparator:int = 2
mScrollingLayerproperty 
protected var mScrollingLayer:Sprite = null
mSelectedItemproperty 
protected var mSelectedItem:Sprite = null
mShadowFilterproperty 
protected var mShadowFilter:DropShadowFilter = null
mSpriteToItemproperty 
protected var mSpriteToItem:Array = null
mTotalRowsproperty 
protected var mTotalRows:int = 0
Constructor detail
SciInventoryDisplay()constructor
public function SciInventoryDisplay(pInventory:Inventory, pActionsArr:Array, pRows:int = 2, pCols:int = 4, pItemWidth:int = 70, pItemHeight:int = 44, pBg:DisplayObject = null, pBgColor:uint = 0xFFFFFF, pBorderColor:uint = 0x000000, pW:Number = 200, pH:Number = 200)

Constructor

Parameters
pInventory:Inventory — the inventory of the player's character
 
pActionsArr:Array — Array of actions id to include in the inventory buttons.
 
pRows:int (default = 2) — visible rows that the inventory will have on screen.
 
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
 
pBg:DisplayObject (default = null) — DisplayObject to use as background.
 
pBgColor:uint (default = 0xFFFFFF) — Color to use as background in the case of pBg is null.
 
pBorderColor:uint (default = 0x000000) — Color to use in the border in the case of pBg is null.
 
pW:Number (default = 200) — Inventory display width.
 
pH:Number (default = 200) — Inventory display height.
Method detail
CreateActionButton()method
protected function CreateActionButton(pAction:String):WakSimpleButtonParameters
pAction:String

Returns
WakSimpleButton
CreateDefaultActionButtons()method 
protected function CreateDefaultActionButtons(pActionsArr:Array):ArrayParameters
pActionsArr:Array

Returns
Array
CreateDownArrow()method 
protected function CreateDownArrow():WakSimpleButton

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

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

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

Returns
WakSimpleButton
DispatchAction()method 
protected function DispatchAction(pActionId:String, pItem:InventoryItem = null):voidParameters
pActionId:String
 
pItem:InventoryItem (default = null)
DrawDefaultButtonBg()method 
protected function DrawDefaultButtonBg(pBtn:Sprite, pW:Number, pH:Number, pColor:uint):voidParameters
pBtn:Sprite
 
pW:Number
 
pH:Number
 
pColor:uint
DrawDownArrow()method 
protected function DrawDownArrow(pBgColor:uint, pArrowColor:uint):SpriteParameters
pBgColor:uint
 
pArrowColor:uint

Returns
Sprite
DrawOkIcon()method 
protected function DrawOkIcon(pBtn:Sprite):voidParameters
pBtn:Sprite
FillInventory()method 
protected function FillInventory(pItItems:IIterator):voidParameters
pItItems:IIterator
OnActionSelected()method 
protected function OnActionSelected(event:Event):voidParameters
event:Event
OnAddedToStage()method 
protected function OnAddedToStage(event:Event):voidParameters
event:Event
OnButtonOkPressed()method 
protected function OnButtonOkPressed(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
OnMouseMove()method 
protected function OnMouseMove(event:MouseEvent):voidParameters
event:MouseEvent
OnRemovedToStage()method 
protected function OnRemovedToStage(event:Event):voidParameters
event:Event
OnScrollDown()method 
protected function OnScrollDown(event:Event):voidParameters
event:Event
OnScrollUp()method 
protected function OnScrollUp(event:Event):voidParameters
event:Event
RefreshItemsPositions()method 
protected function RefreshItemsPositions(pItemsArray:Array):voidParameters
pItemsArray:Array
ScrollDown()method 
protected function ScrollDown():void
ScrollUp()method 
protected function ScrollUp():void
SetActionsButtons()method 
public function SetActionsButtons(pBtnsArray:Array):void

Overrides the pActionsArr passed in the constructor with new actions and set the buttons for that actions.

Parameters
pBtnsArray:Array — Array with WakButtons for the actions.
UpdateScrollButtons()method 
protected function UpdateScrollButtons():void
Event detail
ACTION_SELECTEDevent 
Event object type: org.wak.gui.events.GuiEvent

Dispatched when an action button is clicked inside the inventory window.

INVENTORY_ITEM_SELECTEDevent  
Event object type: org.wak.gui.events.GuiEvent

Dispatched when an inventory item button is selected in the inventory window.