Packageverlocity.components
Classpublic final class verLayers
InheritanceverLayers Inheritance Component Inheritance Singleton Inheritance Object

Stores and handles all the layers and graphics. This is the main way you add content to the screen. Note: When creating layers, know that they stack in order that you call them. In other words create the HUD then Gameplay to have the HUD layer go on top of the Gameplay layer.



Public Properties
 PropertyDefined By
 InheritedclassName : Object
[read-only] Returns the class name of the component for dictionary registration.
Component
  layerDraw : Layer
verLayers
  layerMain : Layer
verLayers
  layerScrFX : Layer
verLayers
  layerUI : Layer
verLayers
  layerVerlocity : Layer
verLayers
Protected Properties
 PropertyDefined By
 Inheritedstage : Stage
Component
Public Methods
 MethodDefined By
  
verLayers(sStage:Stage)
Constructor of the component.
verLayers
  
_Destruct():void
[override] Destructor of the component.
verLayers
  
Loops through all the layers and ends rendering their bitmaps.
verLayers
 Inherited
_IsNotUpdating():Boolean
Returns if the component is not updating (paused).
Component
 Inherited
_IsValid():Boolean
Returns if this singleton is active/valid.
Singleton
 Inherited
_SetUpdating(bUpdating:Boolean):void
Pauses/resumes the component updating, if it's pausable.
Component
  
Loops through all the layers and starts rendering their bitmaps.
verLayers
 Inherited
Updates the component, if possible.
Component
  
addChild(dispObj:DisplayObject, sName:String):void
Inserts a display object into a layer.
verLayers
  
BGColor(uiColor:uint, nAlpha:Number = 1):void
Sets the background color.
verLayers
  
Create(sName:String, bAddToCamera:Boolean = true, bgArt:DisplayObject = null, nPosX:Number = 0, nPosY:Number = 0):Layer
Creates a layer and returns it.
verLayers
  
Get(sName:String):Layer
Returns a layer based on its name.
verLayers
  
IsValidLayer(sName:String):Boolean
Returns if a layer is valid.
verLayers
  
Parallax(aLayers:Array, nScrollX:Number = 0.0, nScrollY:Number = 0.0, nScrollZ:Number = 0.0):void
Preforms a parallaxing effect between a select layers.
verLayers
  
Remove(sName:String):void
Removes a layer.
verLayers
  
RemoveAll():void
Removes all layers.
verLayers
  
removeChild(dispObj:DisplayObject, sName:String):void
Removes a display object from a layer
verLayers
  
ResetAll():void
verLayers
  
ScaleLayer(sName:String, nAddScale:Number, pCenter:Point):void
Scales a layer and its contents from a center position.
verLayers
  
Scroll(sName:String, nScrollX:Number = 0, iScrollWidth:int = 0, nScrollY:Number = 0, iScrollHeight:int = 0):void
Scrolls a layer infinitly.
verLayers
  
SendToBottom(sName:String):void
Sends a layer to the bottom of the display list.
verLayers
  
SendToTop(sName:String):void
Sends a layer to the top of the display list.
verLayers
Protected Methods
 MethodDefined By
 Inherited
Called if verConsole is enabled, used to create concommands for the component.
Component
 Inherited
_Update():void
Called each engine tick (verEngine), if the component updates
Component
Property Detail
layerDrawproperty
public var layerDraw:Layer

layerMainproperty 
public var layerMain:Layer

layerScrFXproperty 
public var layerScrFX:Layer

layerUIproperty 
public var layerUI:Layer

layerVerlocityproperty 
public var layerVerlocity:Layer

Constructor Detail
verLayers()Constructor
public function verLayers(sStage:Stage)

Constructor of the component.

Parameters
sStage:Stage
Method Detail
_Destruct()method
override public function _Destruct():void

Destructor of the component.

_EndRenderBitmaps()method 
public final function _EndRenderBitmaps():void

Loops through all the layers and ends rendering their bitmaps. This is called by verEnts.

_StartRenderBitmaps()method 
public final function _StartRenderBitmaps():void

Loops through all the layers and starts rendering their bitmaps. This is called by verEnts.

addChild()method 
public final function addChild(dispObj:DisplayObject, sName:String):void

Inserts a display object into a layer.

Parameters

dispObj:DisplayObject — The display object to insert.
 
sName:String — The name of the layer.

BGColor()method 
public final function BGColor(uiColor:uint, nAlpha:Number = 1):void

Sets the background color.

Parameters

uiColor:uint — The color to set to.
 
nAlpha:Number (default = 1) — The alpha to set to (note: this will blend with the default Flash background)

Create()method 
public final function Create(sName:String, bAddToCamera:Boolean = true, bgArt:DisplayObject = null, nPosX:Number = 0, nPosY:Number = 0):Layer

Creates a layer and returns it. Layers are created at the bottom of the display list.

Parameters

sName:String — The name of the layer.
 
bAddToCamera:Boolean (default = true) — Should we add this layer to the camera?
 
bgArt:DisplayObject (default = null) — Optional background art the layer has.
 
nPosX:Number (default = 0) — The x position of the layer.
 
nPosY:Number (default = 0) — The y position of the layer.

Returns
Layer
Get()method 
public final function Get(sName:String):Layer

Returns a layer based on its name.

Parameters

sName:String — The name of the layer.

Returns
Layer
IsValidLayer()method 
public final function IsValidLayer(sName:String):Boolean

Returns if a layer is valid.

Parameters

sName:String — The name of the layer.

Returns
Boolean
Parallax()method 
public final function Parallax(aLayers:Array, nScrollX:Number = 0.0, nScrollY:Number = 0.0, nScrollZ:Number = 0.0):void

Preforms a parallaxing effect between a select layers.

Parameters

aLayers:Array — The array of names of layers (requires two or more).
 
nScrollX:Number (default = 0.0) — The X scroll direction.
 
nScrollY:Number (default = 0.0) — The Y scroll direction.
 
nScrollZ:Number (default = 0.0) — The Z scroll direction (warning: really small numbers will lead to visable issues).

Remove()method 
public final function Remove(sName:String):void

Removes a layer.

Parameters

sName:String — The name of the layer.

RemoveAll()method 
public final function RemoveAll():void

Removes all layers.

removeChild()method 
public final function removeChild(dispObj:DisplayObject, sName:String):void

Removes a display object from a layer

Parameters

dispObj:DisplayObject — The display object to remove.
 
sName:String — The name of the layer.

ResetAll()method 
public final function ResetAll():void

ScaleLayer()method 
public final function ScaleLayer(sName:String, nAddScale:Number, pCenter:Point):void

Scales a layer and its contents from a center position.

Parameters

sName:String — The name of the layer.
 
nAddScale:Number — The additive scale to set.
 
pCenter:Point — The center point.

Scroll()method 
public final function Scroll(sName:String, nScrollX:Number = 0, iScrollWidth:int = 0, nScrollY:Number = 0, iScrollHeight:int = 0):void

Scrolls a layer infinitly.

Parameters

sName:String — The name of the layer.
 
nScrollX:Number (default = 0) — How far to scroll horizontally.
 
iScrollWidth:int (default = 0) — The width of the scroll space (where to loop the layer).
 
nScrollY:Number (default = 0) — How far to scroll vertically.
 
iScrollHeight:int (default = 0) — The height of the scroll space (where to loop the layer).

SendToBottom()method 
public final function SendToBottom(sName:String):void

Sends a layer to the bottom of the display list.

Parameters

sName:String — The name of the layer.

SendToTop()method 
public final function SendToTop(sName:String):void

Sends a layer to the top of the display list.

Parameters

sName:String — The name of the layer.