Packageverlocity.components
Classpublic final class verCamera
InheritanceverCamera Inheritance Component Inheritance Singleton Inheritance Object

A simple 2D DisplayObject-based camera. Contains following, zoom, shake, tintint, and masking. Useful for scrolling games and cutscenes. By default, newly created layers (see verLayers) are placed into the camera.



Public Properties
 PropertyDefined By
  brightness : Number
Returns the brightness of the camera.
verCamera
 InheritedclassName : Object
[read-only] Returns the class name of the component for dictionary registration.
Component
  contrast : Number
Returns the contrast of the camera.
verCamera
  height : Number
[read-only] Returns the height of the camera.
verCamera
  hue : Number
Returns the hue of the camera.
verCamera
  IsEasing : Boolean
[read-only] Returns if the camera is easing.
verCamera
  IsEasingX : Boolean
[read-only] Returns if the camera is easing on the X axis.
verCamera
  IsEasingY : Boolean
[read-only] Returns if the camera is easing on the Y axis.
verCamera
  saturation : Number
Returns the saturation of the camera.
verCamera
  width : Number
[read-only] Returns the width of the camera.
verCamera
  x : Number
Returns the X position of the camera.
verCamera
  y : Number
Returns the Y position of the camera.
verCamera
  zoom : Number
Returns the zoom of the camera.
verCamera
Protected Properties
 PropertyDefined By
 Inheritedstage : Stage
Component
Public Methods
 MethodDefined By
  
verCamera(sStage:Stage)
Constructor of the component.
verCamera
  
_Destruct():void
[override] Destructor of the component.
verCamera
  
_Get():Sprite
Returns the camera sprite
verCamera
  
_GetView():Shape
Returns the camera view area
verCamera
 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
 Inherited
Updates the component, if possible.
Component
  
Add(disp:DisplayObject, bAddToBottom:Boolean = false):void
Adds a display object to the camera.
verCamera
  
AdjustColors(nBrightness:Number, nContrast:Number, nHue:Number, nSaturation:Number):void
verCamera
  
Follow(ent:DynamicEntity, iOffsetX:int = 0, iOffsetY:int = 0, bEase:Boolean = true, iEaseSpeed:int = 30):void
Sets the camera to follows an entity.
verCamera
  
MoveTo(pPoint:Point, bEase:Boolean = true, iEaseSpeed:int = 30):void
Moves the camera to a specific point
verCamera
  
RemoveAll():void
Removes all display objects in the camera.
verCamera
  
Removes all filters on the camera
verCamera
  
RemoveTint():void
Removes the tint of the camera
verCamera
  
Reset():void
Resets all the properties of the camera.
verCamera
  
ResetColor():void
Resets the camera's color to its default
verCamera
  
ResetMask():void
Resets the masking to its default (ie.
verCamera
  
ResetPos():void
Resets the camera's position to its default (0,0).
verCamera
  
Rotate(nRot:Number):void
Rotates the camera around its center
verCamera
  
SetCenterPos(nPosX:Number, nPosY:Number):void
Centers the camera on a position.
verCamera
  
SetColor(r:int, g:int, b:int, alpha:Number = 1):void
Sets the camera to a specific color
verCamera
  
SetLayer(sLayer:String):void
Sets the layer the camera is in.
verCamera
  
SetMask(mask:DisplayObject):void
Sets the viewable mask of the camera
verCamera
  
SetMaskPos(iPosX:int, iPosY:int):void
Sets the position of the mask
verCamera
  
SetTint(amount:Number, r:int = 255, g:int = 255, b:int = 255):void
Sets the tint of the camera
verCamera
  
SetZoom(nSetZoom:Number):void
Zooms the camera
verCamera
  
Shake(iDuration:int, nForce:Number):void
Shakes the camera
verCamera
  
Stops the camera from following an entity
verCamera
  
StopMoveTo():void
Stops moving the camera to a specific point (if MoveTo was called)
verCamera
  
Stop shaking the camera
verCamera
Protected Methods
 MethodDefined By
  
[override] Concommands of the component.
verCamera
  
_Update():void
[override] Updates the camera
verCamera
Property Detail
brightnessproperty
brightness:Number

Returns the brightness of the camera.


Implementation
    public function get brightness():Number
    public function set brightness(value:Number):void
contrastproperty 
contrast:Number

Returns the contrast of the camera.


Implementation
    public function get contrast():Number
    public function set contrast(value:Number):void
heightproperty 
height:Number  [read-only]

Returns the height of the camera.


Implementation
    public function get height():Number
hueproperty 
hue:Number

Returns the hue of the camera.


Implementation
    public function get hue():Number
    public function set hue(value:Number):void
IsEasingproperty 
IsEasing:Boolean  [read-only]

Returns if the camera is easing.


Implementation
    public function get IsEasing():Boolean
IsEasingXproperty 
IsEasingX:Boolean  [read-only]

Returns if the camera is easing on the X axis.


Implementation
    public function get IsEasingX():Boolean
IsEasingYproperty 
IsEasingY:Boolean  [read-only]

Returns if the camera is easing on the Y axis.


Implementation
    public function get IsEasingY():Boolean
saturationproperty 
saturation:Number

Returns the saturation of the camera.


Implementation
    public function get saturation():Number
    public function set saturation(value:Number):void
widthproperty 
width:Number  [read-only]

Returns the width of the camera.


Implementation
    public function get width():Number
xproperty 
x:Number

Returns the X position of the camera.


Implementation
    public function get x():Number
    public function set x(value:Number):void
yproperty 
y:Number

Returns the Y position of the camera.


Implementation
    public function get y():Number
    public function set y(value:Number):void
zoomproperty 
zoom:Number

Returns the zoom of the camera.


Implementation
    public function get zoom():Number
    public function set zoom(value:Number):void
Constructor Detail
verCamera()Constructor
public function verCamera(sStage:Stage)

Constructor of the component.

Parameters
sStage:Stage
Method Detail
_Concommands()method
override protected function _Concommands():void

Concommands of the component.

_Destruct()method 
override public function _Destruct():void

Destructor of the component.

_Get()method 
public final function _Get():Sprite

Returns the camera sprite

Returns
Sprite
_GetView()method 
public final function _GetView():Shape

Returns the camera view area

Returns
Shape
_Update()method 
override protected function _Update():void

Updates the camera

Add()method 
public final function Add(disp:DisplayObject, bAddToBottom:Boolean = false):void

Adds a display object to the camera.

Parameters

disp:DisplayObject — The display object
 
bAddToBottom:Boolean (default = false) — Add to the bottom?

AdjustColors()method 
public final function AdjustColors(nBrightness:Number, nContrast:Number, nHue:Number, nSaturation:Number):void

Parameters

nBrightness:Number (default = NaN)
 
nContrast:Number (default = NaN)
 
nHue:Number (default = NaN)
 
nSaturation:Number (default = NaN)

Follow()method 
public final function Follow(ent:DynamicEntity, iOffsetX:int = 0, iOffsetY:int = 0, bEase:Boolean = true, iEaseSpeed:int = 30):void

Sets the camera to follows an entity.

Parameters

ent:DynamicEntity — The dynamic entity to follow
 
iOffsetX:int (default = 0) — Offset the camera
 
iOffsetY:int (default = 0) — Offset the camera
 
bEase:Boolean (default = true) — Should the camera ease?
 
iEaseSpeed:int (default = 30) — The speed the easing is preformed at

MoveTo()method 
public final function MoveTo(pPoint:Point, bEase:Boolean = true, iEaseSpeed:int = 30):void

Moves the camera to a specific point

Parameters

pPoint:Point — The point to move towards
 
bEase:Boolean (default = true) — Should the camera ease?
 
iEaseSpeed:int (default = 30) — The speed at which the camera eases at

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

Removes all display objects in the camera.

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

Removes all filters on the camera

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

Removes the tint of the camera

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

Resets all the properties of the camera.

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

Resets the camera's color to its default

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

Resets the masking to its default (ie. removes custom mask)

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

Resets the camera's position to its default (0,0).

Rotate()method 
public final function Rotate(nRot:Number):void

Rotates the camera around its center

Parameters

nRot:Number — Degree to rotate

SetCenterPos()method 
public final function SetCenterPos(nPosX:Number, nPosY:Number):void

Centers the camera on a position.

Parameters

nPosX:Number — The X position
 
nPosY:Number — The Y position

SetColor()method 
public final function SetColor(r:int, g:int, b:int, alpha:Number = 1):void

Sets the camera to a specific color

Parameters

r:int — Red
 
g:int — Green
 
b:int — Blue
 
alpha:Number (default = 1) — Alpha

SetLayer()method 
public final function SetLayer(sLayer:String):void

Sets the layer the camera is in.

Parameters

sLayer:String

SetMask()method 
public final function SetMask(mask:DisplayObject):void

Sets the viewable mask of the camera

Parameters

mask:DisplayObject — The mask

SetMaskPos()method 
public final function SetMaskPos(iPosX:int, iPosY:int):void

Sets the position of the mask

Parameters

iPosX:int
 
iPosY:int

SetTint()method 
public final function SetTint(amount:Number, r:int = 255, g:int = 255, b:int = 255):void

Sets the tint of the camera

Parameters

amount:Number — Amount of tinting
 
r:int (default = 255) — Red
 
g:int (default = 255) — Green
 
b:int (default = 255) — Blue

SetZoom()method 
public final function SetZoom(nSetZoom:Number):void

Zooms the camera

Parameters

nSetZoom:Number — Amount to zoom

Shake()method 
public final function Shake(iDuration:int, nForce:Number):void

Shakes the camera

Parameters

iDuration:int — Duration of the shake
 
nForce:Number — The force of the shake

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

Stops the camera from following an entity

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

Stops moving the camera to a specific point (if MoveTo was called)

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

Stop shaking the camera