Packageverlocity.components
Classpublic final class verEngine
InheritanceverEngine Inheritance Component Inheritance Singleton Inheritance Object

The main control loop of the engine. Contains timescale functions and loop hooks.



Public Properties
 PropertyDefined By
 InheritedclassName : Object
[read-only] Returns the class name of the component for dictionary registration.
Component
  DT : Number
[read-only] Returns the delta time
verEngine
Protected Properties
 PropertyDefined By
 Inheritedstage : Stage
Component
Public Methods
 MethodDefined By
  
verEngine(sStage:Stage)
Constructor of the component.
verEngine
  
_Destruct():void
[override] Destructor of the component.
verEngine
 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
  
CurTime():uint
Returns the current time (in miliseconds).
verEngine
  
Hook(newObj:Object):void
Hooks an object to the game loop.
verEngine
  
IsPaused():Boolean
Returns if the engine ticks are paused.
verEngine
  
Pause():void
Pauses the main game loop.
verEngine
  
Removes all current hooked objects in the engine.
verEngine
  
Resume():void
Resumes the main game loop.
verEngine
  
SetTimeScale(nNewTimeScale:Number, bAdjustFramerate:Boolean = false):void
Sets the timescale of the engine.
verEngine
  
UnHook(objToRemove:Object):void
Removes an object from the engine hook.
verEngine
Protected Methods
 MethodDefined By
  
[override] Concommands of the component.
verEngine
 Inherited
_Update():void
Called each engine tick (verEngine), if the component updates
Component
Property Detail
DTproperty
DT:Number  [read-only]

Returns the delta time


Implementation
    public function get DT():Number
Constructor Detail
verEngine()Constructor
public function verEngine(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.

CurTime()method 
public final function CurTime():uint

Returns the current time (in miliseconds).

Returns
uint
Hook()method 
public final function Hook(newObj:Object):void

Hooks an object to the game loop. It will not add duplicates. Note: Requires a public function named 'Update' in the object.

Parameters

newObj:Object — The object you want to hook into the main game loop.

IsPaused()method 
public final function IsPaused():Boolean

Returns if the engine ticks are paused.

Returns
Boolean
Pause()method 
public final function Pause():void

Pauses the main game loop.

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

Removes all current hooked objects in the engine. Very useful for state changes.

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

Resumes the main game loop.

SetTimeScale()method 
public final function SetTimeScale(nNewTimeScale:Number, bAdjustFramerate:Boolean = false):void

Sets the timescale of the engine. Lower than 1 will result in slowed down time.

Parameters

nNewTimeScale:Number — The new timescale to set to (min = 0, max = 5 ).
 
bAdjustFramerate:Boolean (default = false)

UnHook()method 
public final function UnHook(objToRemove:Object):void

Removes an object from the engine hook. MAKE SURE TO DO THIS BEFORE YOU REMOVE ANY HOOKED OBJECTS!

Parameters

objToRemove:Object — The object you want to remove from the main game loop.