Packageverlocity.ents
Classpublic class DisplayEntity
InheritanceDisplayEntity Inheritance DynamicEntity Inheritance Entity Inheritance Object
Subclasses Effect, Pickup, ScreenEffect



Public Properties
 PropertyDefined By
  absX : Number
[override] [read-only] Returns the absolute X position.
DisplayEntity
  absY : Number
[override] [read-only] Returns the absolute Y position.
DisplayEntity
  baseClass : Object
[override] [read-only] Returns the entity base class.
DisplayEntity
  bitmapClip : BitmapClip
[read-only] Returns the bitmap clip of the entity.
DisplayEntity
  bounds : Rectangle
[read-only] Returns the bounds of the display entity
DisplayEntity
 InheritedcollisionRect : CRectangle
[read-only] Returns the collision rect
DynamicEntity
  currentFrame : int
[read-only] Gets the current frame of the display object (if it's a MovieClip/_bitmapClip)
DisplayEntity
  currentFrameLabel : String
[read-only] Gets the current frame label of the display object (if it's a MovieClip)
DisplayEntity
  currentLayer : Layer
[read-only] A getter that returns the layer the entity is currently in.
DisplayEntity
  currentLayerName : String
[read-only] A getter that returns the layer name the entity is currently in.
DisplayEntity
 InheriteddefaultHealth : int
[read-only] A getter that returns the default health the entity has.
Entity
  _display : Boolean
[override] [read-only] Returns if this entity base contains display functionality (will not Init until spawned).
DisplayEntity
  displayObj : DisplayObject
[read-only] Returns the display object of the entity.
DisplayEntity
  displayType : Class
[read-only] Returns the display type class
DisplayEntity
 Inherited_dynamic : Boolean
[override] [read-only] Returns if the entity is dynamic.
DynamicEntity
  graphics : Graphics
[read-only] Returns the graphics object.
DisplayEntity
  halfHeight : Number
[read-only] A getter that returns the height divided by two (center of y).
DisplayEntity
  halfWidth : Number
[read-only] A getter that returns the width divided by two (center of x).
DisplayEntity
 Inheritedhealth : int
[read-only] A getter that returns the current health value of the entity.
Entity
  height : Number
Returns the height of the display entity.
DisplayEntity
 Inherited_id : int
Returns the registration ID of the entity.
Entity
 InheritedinitX : Number
[read-only] A getter that returns the initial X position.
DynamicEntity
 InheritedinitY : Number
[read-only] A getter that returns the initial Y position.
DynamicEntity
 InheritedmaxHealth : int
A getter that returns the maximum health this entity can have.
Entity
  parent : DisplayObjectContainer
[read-only] Returns the parent display object container.
DisplayEntity
 Inheritedphys : PhysObject
[read-only] Returns the physics object (short-hand).
DynamicEntity
  rotation : Number
Returns the rotation of the display entity
DisplayEntity
  scaleX : Number
Returns the X scale of the display entity.
DisplayEntity
  scaleY : Number
Returns the Y scale of the display entity.
DisplayEntity
  sourceClass : Class
[read-only] Returns the artwork source class name
DisplayEntity
  totalFrames : int
[read-only] Gets the total frames of the display object (if it's a MovieClip/_bitmapClip)
DisplayEntity
  width : Number
Returns the width of the display entity.
DisplayEntity
  x : Number
[override] Sets the position of the display entity.
DisplayEntity
  y : Number
[override] Sets the position of the display entity.
DisplayEntity
Protected Properties
 PropertyDefined By
 InheritedbCollisionEnabled : Boolean
DynamicEntity
  bIsBeingRemoved : Boolean
DisplayEntity
  bIsSpawned : Boolean
DisplayEntity
  _bitmap : Bitmap
DisplayEntity
  _bitmapData : BitmapData
DisplayEntity
  _bitmapDataRect : Rectangle
DisplayEntity
  _bitmapDrawRect : Rectangle
DisplayEntity
  ctColor : ColorTransform
DisplayEntity
  cTint : Color
DisplayEntity
 InheritediBoundPadding : int = 100
DynamicEntity
 InheritediCollisionFlags : int
DynamicEntity
 InheritediRemoveOffScreenPadding : int = 100
DynamicEntity
  lLayer : Layer
DisplayEntity
  nAlpha : Number = 1
DisplayEntity
 InheritednInitialX : Number
DynamicEntity
 InheritednInitialY : Number
DynamicEntity
 InheritednPosX : Number
DynamicEntity
 InheritednPosY : Number
DynamicEntity
 InheritedrectBounds : Rectangle
DynamicEntity
 InheritedrectCollision : CRectangle
DynamicEntity
  uiColor : uint
DisplayEntity
Public Methods
 MethodDefined By
  
_Dispose():void
[override] Cleans the entity's data.
DisplayEntity
  
_Update():void
[override] Called each engine tick, do not override this.
DisplayEntity
  
addChild(disp:DisplayObject):void
Adds a child display object
DisplayEntity
  
BitmapDrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, uiColor:uint):void
Draws a simple rectangle in the drawable bitmap (see CreateDrawableBitmap).
DisplayEntity
  
Clear():void
Clears the graphics of the display object of the entity.
DisplayEntity
 Inherited
Clears the boundaries of the entity.
DynamicEntity
 Inherited
Construct():void
Called before the entity is spawned to setup the constants of the entity.
Entity
  
CreateDrawableBitmap(iWidth:int, iHeight:int, bOverrideDisplay:Boolean = false):void
Creates a bitmap canvas for graphic drawing.
DisplayEntity
 Inherited
DeInit():void
Called when the entity is deleted.
Entity
  
DisplayIs(cClassName:Class):Boolean
Returns if the display is a specified base class.
DisplayEntity
  
DrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, nAlpha:Number = 1, uiColor:uint):void
Draws a simple rectangle in the display object.
DisplayEntity
 Inherited
EmitSound(sSound:*, nStartVolume:Number = 1, bLoops:Boolean = false, bParent:Boolean = false, bFadeIn:Boolean = false):void
Plays a sound at the location of the entity.
DynamicEntity
 Inherited
EnableCollision(bEnable:Boolean = true):void
Enables/disables calculations for collision.
DynamicEntity
 Inherited
EnablePhysics(bEnable:Boolean = true, bRemovePhysicsObj:Boolean = true):void
Enables/disables calculations for physics.
DynamicEntity
 Inherited
EnableUpdate(bUpdate:Boolean = true):void
Sets if the entity will update each engine tick.
Entity
  
FadeColors(oldColor:uint, newColor:uint, amount:Number = 1):void
Fades between two colors (hex).
DisplayEntity
  
FadeColorsRGB(oldR:int, oldG:int, oldB:int, newR:int, newG:int, newB:int, amount:Number = 1):void
Fades between two RGB values.
DisplayEntity
  
FadeRemove(nSetFadeSpeed:Number = 0.05):void
Removes the entity with a fading effect.
DisplayEntity
  
GetAlpha():Number
Returns the overall transparency of the entity.
DisplayEntity
  
GetAngle():Point
Returns the angle of rotation as a unit vector.
DisplayEntity
 Inherited
GetClass():Object
Returns the class of the entity.
Entity
  
GetColor():uint
Returns the color of the entity.
DisplayEntity
 Inherited
Returns the rotation (0-360) from the relation of the mouse and the entity.
DynamicEntity
 Inherited
GetOwner():Object
Returns the current owner of the entity.
Entity
 Inherited
Returns the physics object
DynamicEntity
 Inherited
GetPos():Point
Returns the current position as a point
DynamicEntity
  
GetScale():Number
Returns the current scale of the entity.
DisplayEntity
 Inherited
GetType():String
Returns the current string type of the entity.
Entity
  
HasEnded():Boolean
Returns if the MovieClip/_bitmapClip
DisplayEntity
 Inherited
HasMoved():Boolean
Returns if the entity has moved (determined by its previous position set) This is used to optimize collision and physics calculations
DynamicEntity
 Inherited
Init():void
Called when the entity is first registered/spawned.
Entity
 Inherited
Is(cClass:Class):Boolean
Returns if the entity matches a class.
Entity
  
IsBeingRemoved():Boolean
Returns if the entity is being fade removed.
DisplayEntity
 Inherited
Returns the method of basic collision between other types
DynamicEntity
 Inherited
Returns if collision is enabled
DynamicEntity
 Inherited
IsCollisionFlagOn(iCollisionFlag:int):Boolean
Returns if a collision flag is enabled or not.
DynamicEntity
 Inherited
IsDead():Boolean
Returns if the entity is dead.
Entity
 Inherited
IsHealthZero():Boolean
Returns if the health is zero.
Entity
 Inherited
DynamicEntity
 Inherited
IsOnBoundary():Boolean
DynamicEntity
 Inherited
DynamicEntity
 Inherited
DynamicEntity
 Inherited
IsOnScreen():Boolean
Returns if the entity is within the boundaries of the screen.
DynamicEntity
 Inherited
IsOnTopBoundary():Boolean
DynamicEntity
 Inherited
IsOnXBoundary():Boolean
DynamicEntity
 Inherited
IsOnYBoundary():Boolean
DynamicEntity
 Inherited
Returns if physics is enabled
DynamicEntity
  
IsPlaying():Boolean
Returns if the display object (if it's a MovieClip/_bitmapClip) is currently playing
DisplayEntity
 Inherited
IsProtected():Boolean
Returns if the entity is protected.
Entity
  
IsSpawned():Boolean
Returns if the entity was spawned.
DisplayEntity
 Inherited
IsT(sCheckType:String):Boolean
Returns if the entity is matches a type (lowercase only).
Entity
 Inherited
IsUpdating():Boolean
Returns if the entity is updating.
Entity
  
Kill(bPlayAnim:Boolean = false):void
Plays the death animation of the entity and removes it.
DisplayEntity
 Inherited
OnCollide(ent:*):void
Called when a rectangle collision occured
DynamicEntity
  
Pause():void
Pauses the display object (if it's a MovieClip/_bitmapClip and was playing)
DisplayEntity
  
Play():void
Plays the display object (if it's a MovieClip/BitmapClip)
DisplayEntity
 Inherited
Remove():void
Marks the entity for removal.
Entity
  
Removes the color transforms, tinting, and alpha changes applied to the entity.
DisplayEntity
 Inherited
Removes all health of the entity.
Entity
  
removeChild(disp:DisplayObject):void
Removes a child display object
DisplayEntity
  
Removes all displays of the entity.
DisplayEntity
  
Removes the bitmap drawable, if it exists.
DisplayEntity
  
Removes the filters of the display object
DisplayEntity
 Inherited
RemoveOffScreen(bShouldRemove:Boolean = true, iPadding:int = 100):void
Tells the entity to remove itself when its off screen.
DynamicEntity
  
RemoveTint():void
Removes any tinting applied.
DisplayEntity
  
Reset():void
[override] Resets the entity to its original values.
DisplayEntity
 Inherited
Resets the entity's health to the default health.
Entity
 Inherited
ResetPos():void
Resets the entity to its initial position.
DynamicEntity
  
ResetScale():void
Resets the scale of the entity to defaults (1).
DisplayEntity
  
Respawn():void
Calls DeInit then Init.
DisplayEntity
  
Resume():void
Resumes the display object (if it's a MovieClip/_bitmapClip and was playing)
DisplayEntity
  
SetAlpha(nSetAlpha:Number):void
Sets the overall transparency of the entity.
DisplayEntity
 Inherited
SetBounds(rectSetBounds:Rectangle, iInnerPadding:int = 0):void
Sets the screen boundaries of the entity.
DynamicEntity
 Inherited
SetCollisionFlags(iFlags:int):void
Set collision flags.
DynamicEntity
 Inherited
SetCollisionRect(rect:Rectangle, nOffsetX:Number = 0, nOffsetY:Number = 0):void
Sets the collision rect (required for collision)
DynamicEntity
  
SetColor(newColor:uint, nAlpha:Number = 1):void
Sets the color of the entity.
DisplayEntity
  
SetColorRGB(r:int = 255, g:int = 255, b:int = 255, nAlpha:Number = 1):void
Sets the color of the entity with RGB.
DisplayEntity
 Inherited
SetDefaultHealth(setHealth:int = 100):void
Sets the default health of this entity.
Entity
  
SetDisplayObject(dispObject:DisplayObject, bBitmap:Boolean = false, iFPS:int = 60):void
Sets the display object of the entity - i.e.
DisplayEntity
  
SetFilters(... filters):void
Sets the filters of the display object.
DisplayEntity
  
SetFrame(iFrame:int, bPlayAnim:Boolean = true):void
Sets the display object (if it's a MovieClip/BitmapClip) to a specific frame number.
DisplayEntity
  
SetFrameLabel(sString:String, bPlayAnim:Boolean = true):void
Sets the display object (if it's a MovieClip/BitmapClip) to a specific labeled frame.
DisplayEntity
 Inherited
SetHealth(newHealth:int):void
Sets the health value of this entity.
Entity
 Inherited
SetOwner(newOwner:Object):void
Sets the owner of the entity.
Entity
 Inherited
SetPhysicsProperties(nMass:Number, pVelocityDirection:Point, nVelocityMagnitude:Number):void
Sets the physicial properies of this entity
DynamicEntity
 Inherited
SetPos(nSetPosX:Number, nSetPosY:Number):void
Sets the X and Y position of the entity
DynamicEntity
 Inherited
SetProtected(bProtected:Boolean = true):void
Protects an entity from being removed by clean up calls, such as CleanSlate.
Entity
  
SetRandomFrame(bPlayAnim:Boolean = false):void
Sets the display object (if it's a MovieClip/BitmapClip) to a random frame.
DisplayEntity
  
SetRemoveTime(iMilliSecs:int, bFadeOut:Boolean = false, nSetFadeSpeed:Number = 0.05):void
Sets the time the entity should be removed in.
DisplayEntity
  
SetRotation(iRot:int):void
Sets the rotation of the entity.
DisplayEntity
  
SetScale(nSetScale:Number):void
Sets the scale of the entity.
DisplayEntity
  
SetTint(amount:Number, newColor:uint):void
Sets the tint of the entity.
DisplayEntity
  
SetTintRGB(amount:Number, r:int = 255, g:int = 255, b:int = 255):void
Sets the tint of the entity with RGB.
DisplayEntity
 Inherited
SetType(sSetType:String):void
Sets the string type of the entity.
Entity
  
Sets up the collision bounds.
DisplayEntity
  
Spawn(sSetLayer:String, bSpawnOnBottom:Boolean = false):void
Spawns the entity into a layer and calls Init.
DisplayEntity
  
Stop():void
Stops the display object (if it's a MovieClip/_bitmapClip)
DisplayEntity
 Inherited
Stops all sounds that are emitting from this entity.
DynamicEntity
  
SwapLayer(sSetLayer:String, bSpawnOnBottom:Boolean = false):void
Swaps the current layer of the entity.
DisplayEntity
 Inherited
TakeDamage(iDamageAmount:int):void
Subtracts the current health.
Entity
 Inherited
Update():void
Called each engine tick.
Entity
Protected Methods
 MethodDefined By
 Inherited
CalcXBoundaries(nSetPosX:Number):void
Calculates if a position is beyond the Y boundaries
DynamicEntity
 Inherited
CalcYBoundaries(nSetPosY:Number):void
Calculates if a position is beyond the Y boundaries
DynamicEntity
 Inherited
DynamicEntity
 Inherited
OnDeath():void
Called when the entity's health is now 0.
Entity
 Inherited
Called when the entity's health has been changed.
Entity
  
OnKill():void
Called when the entity is killed.
DisplayEntity
  
OnRespawn():void
Called when the entity is repawned with the Respawn function
DisplayEntity
 Inherited
Called when the entity took damage via TakeDamage function.
Entity
 Inherited
UpdateCollisionRect(nSetPosX:Number, nSetPosY:Number, nSetScaleX:Number, nSetScaleY:Number, nSetWidth:Number, nSetHeight:Number, nSetOffsetX:Number, nSetOffsetY:Number):void
Update the position/scale of the collision rect
DynamicEntity
Property Detail
_bitmapproperty
protected var _bitmap:Bitmap

_bitmapDataproperty 
protected var _bitmapData:BitmapData

_bitmapDataRectproperty 
protected var _bitmapDataRect:Rectangle

_bitmapDrawRectproperty 
protected var _bitmapDrawRect:Rectangle

_displayproperty 
_display:Boolean  [read-only] [override]

Returns if this entity base contains display functionality (will not Init until spawned).


Implementation
    public function get _display():Boolean
absXproperty 
absX:Number  [read-only] [override]

Returns the absolute X position.


Implementation
    public function get absX():Number
absYproperty 
absY:Number  [read-only] [override]

Returns the absolute Y position.


Implementation
    public function get absY():Number
baseClassproperty 
baseClass:Object  [read-only] [override]

Returns the entity base class.


Implementation
    public function get baseClass():Object
bIsBeingRemovedproperty 
protected var bIsBeingRemoved:Boolean

bIsSpawnedproperty 
protected var bIsSpawned:Boolean

bitmapClipproperty 
bitmapClip:BitmapClip  [read-only]

Returns the bitmap clip of the entity.


Implementation
    public function get bitmapClip():BitmapClip
boundsproperty 
bounds:Rectangle  [read-only]

Returns the bounds of the display entity


Implementation
    public function get bounds():Rectangle
ctColorproperty 
protected var ctColor:ColorTransform

cTintproperty 
protected var cTint:Color

currentFrameproperty 
currentFrame:int  [read-only]

Gets the current frame of the display object (if it's a MovieClip/_bitmapClip)


Implementation
    public function get currentFrame():int
currentFrameLabelproperty 
currentFrameLabel:String  [read-only]

Gets the current frame label of the display object (if it's a MovieClip)


Implementation
    public function get currentFrameLabel():String
currentLayerproperty 
currentLayer:Layer  [read-only]

A getter that returns the layer the entity is currently in.


Implementation
    public function get currentLayer():Layer
currentLayerNameproperty 
currentLayerName:String  [read-only]

A getter that returns the layer name the entity is currently in.


Implementation
    public function get currentLayerName():String
displayObjproperty 
displayObj:DisplayObject  [read-only]

Returns the display object of the entity.


Implementation
    public function get displayObj():DisplayObject
displayTypeproperty 
displayType:Class  [read-only]

Returns the display type class


Implementation
    public function get displayType():Class
graphicsproperty 
graphics:Graphics  [read-only]

Returns the graphics object. Works for: DisplayObject


Implementation
    public function get graphics():Graphics
halfHeightproperty 
halfHeight:Number  [read-only]

A getter that returns the height divided by two (center of y).


Implementation
    public function get halfHeight():Number
halfWidthproperty 
halfWidth:Number  [read-only]

A getter that returns the width divided by two (center of x).


Implementation
    public function get halfWidth():Number
heightproperty 
height:Number

Returns the height of the display entity.


Implementation
    public function get height():Number
    public function set height(value:Number):void
lLayerproperty 
protected var lLayer:Layer

nAlphaproperty 
protected var nAlpha:Number = 1

parentproperty 
parent:DisplayObjectContainer  [read-only]

Returns the parent display object container. Works for: DisplayObject


Implementation
    public function get parent():DisplayObjectContainer
rotationproperty 
rotation:Number

Returns the rotation of the display entity


Implementation
    public function get rotation():Number
    public function set rotation(value:Number):void
scaleXproperty 
scaleX:Number

Returns the X scale of the display entity.


Implementation
    public function get scaleX():Number
    public function set scaleX(value:Number):void
scaleYproperty 
scaleY:Number

Returns the Y scale of the display entity.


Implementation
    public function get scaleY():Number
    public function set scaleY(value:Number):void
sourceClassproperty 
sourceClass:Class  [read-only]

Returns the artwork source class name


Implementation
    public function get sourceClass():Class
totalFramesproperty 
totalFrames:int  [read-only]

Gets the total frames of the display object (if it's a MovieClip/_bitmapClip)


Implementation
    public function get totalFrames():int
uiColorproperty 
protected var uiColor:uint

widthproperty 
width:Number

Returns the width of the display entity.


Implementation
    public function get width():Number
    public function set width(value:Number):void
xproperty 
x:Number[override]

Sets the position of the display entity. Works for: DisplayObject, BitmapClip


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

Sets the position of the display entity. Works for: DisplayObject, BitmapClip


Implementation
    public function get y():Number
    public function set y(value:Number):void
Method Detail
_Dispose()method
override public function _Dispose():void

Cleans the entity's data. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!

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

Called each engine tick, do not override this. DO NOT CALL MANUALLY - THIS IS HANDLED BY verEnts!

addChild()method 
public function addChild(disp:DisplayObject):void

Adds a child display object

Parameters

disp:DisplayObject — Works for: DisplayObject

BitmapDrawRect()method 
public function BitmapDrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, uiColor:uint):void

Draws a simple rectangle in the drawable bitmap (see CreateDrawableBitmap). Color is based on the set color of the entity, unless specified.

Parameters

drawX:int — X position to start the rectangle at.
 
drawY:int — Y position to start the rectangle at.
 
drawWidth:Number — Width of the rectangle.
 
drawHeight:Number — Height of the rectangle.
 
uiColor:uint (default = NaN) — Fill color (defaults to color of entity).

Clear()method 
public function Clear():void

Clears the graphics of the display object of the entity. Only works with DisplayObjects

CreateDrawableBitmap()method 
public function CreateDrawableBitmap(iWidth:int, iHeight:int, bOverrideDisplay:Boolean = false):void

Creates a bitmap canvas for graphic drawing. Only works if there's a DisplayObject to this entity.

Parameters

iWidth:int — The width of the bitmap
 
iHeight:int — The height of the bitmap
 
bOverrideDisplay:Boolean (default = false) — Should we remove the display object of this entity and replace with the drawable bitmap?

DisplayIs()method 
public function DisplayIs(cClassName:Class):Boolean

Returns if the display is a specified base class.

Parameters

cClassName:Class — The class to check if the display matches

Returns
Boolean
DrawRect()method 
public function DrawRect(drawX:int, drawY:int, drawWidth:Number, drawHeight:Number, nAlpha:Number = 1, uiColor:uint):void

Draws a simple rectangle in the display object. Color is based on the set color of the entity, unless specified.

Parameters

drawX:int — X position to start the rectangle at.
 
drawY:int — Y position to start the rectangle at.
 
drawWidth:Number — Width of the rectangle.
 
drawHeight:Number — Height of the rectangle.
 
nAlpha:Number (default = 1) — Alpha of the rectangle fill.
 
uiColor:uint (default = NaN) — Fill color (defaults to color of entity).

FadeColors()method 
public function FadeColors(oldColor:uint, newColor:uint, amount:Number = 1):void

Fades between two colors (hex).

Parameters

oldColor:uint — Original color
 
newColor:uint — New color
 
amount:Number (default = 1) — The amount of blending to occur (0-1).

FadeColorsRGB()method 
public function FadeColorsRGB(oldR:int, oldG:int, oldB:int, newR:int, newG:int, newB:int, amount:Number = 1):void

Fades between two RGB values.

Parameters

oldR:int — Original red amount (0-255).
 
oldG:int — Original green amount (0-255).
 
oldB:int — Original blue amount (0-255).
 
newR:int — New red amount (0-255).
 
newG:int — New green amount (0-255).
 
newB:int — New blue amount (0-255).
 
amount:Number (default = 1) — The amount of blending to occur (0-1).

FadeRemove()method 
public function FadeRemove(nSetFadeSpeed:Number = 0.05):void

Removes the entity with a fading effect.

Parameters

nSetFadeSpeed:Number (default = 0.05) — The speed the entity will fade out at.

GetAlpha()method 
public function GetAlpha():Number

Returns the overall transparency of the entity.

Returns
Number
GetAngle()method 
public function GetAngle():Point

Returns the angle of rotation as a unit vector.

Returns
Point
GetColor()method 
public function GetColor():uint

Returns the color of the entity. Requires SetColor to be called first. Defaults to white (0xFFFFFF).

Returns
uint
GetScale()method 
public function GetScale():Number

Returns the current scale of the entity.

Returns
Number
HasEnded()method 
public function HasEnded():Boolean

Returns if the MovieClip/_bitmapClip

Returns
Boolean
IsBeingRemoved()method 
public function IsBeingRemoved():Boolean

Returns if the entity is being fade removed.

Returns
Boolean
IsPlaying()method 
public function IsPlaying():Boolean

Returns if the display object (if it's a MovieClip/_bitmapClip) is currently playing

Returns
Boolean
IsSpawned()method 
public function IsSpawned():Boolean

Returns if the entity was spawned.

Returns
Boolean
Kill()method 
public function Kill(bPlayAnim:Boolean = false):void

Plays the death animation of the entity and removes it. Requires a MovieClip with the frame label "die". Note: Make sure the "die" frame label is at the end of the MovieClip's timeline.

Parameters

bPlayAnim:Boolean (default = false)

OnKill()method 
protected function OnKill():void

Called when the entity is killed.

OnRespawn()method 
protected function OnRespawn():void

Called when the entity is repawned with the Respawn function

Pause()method 
public function Pause():void

Pauses the display object (if it's a MovieClip/_bitmapClip and was playing)

Play()method 
public function Play():void

Plays the display object (if it's a MovieClip/BitmapClip)

RemoveAllColorProperties()method 
public function RemoveAllColorProperties():void

Removes the color transforms, tinting, and alpha changes applied to the entity.

removeChild()method 
public function removeChild(disp:DisplayObject):void

Removes a child display object

Parameters

disp:DisplayObject — Works for: DisplayObject

RemoveDisplay()method 
public function RemoveDisplay():void

Removes all displays of the entity.

RemoveDrawableBitmap()method 
public function RemoveDrawableBitmap():void

Removes the bitmap drawable, if it exists.

RemoveFilters()method 
public function RemoveFilters():void

Removes the filters of the display object

RemoveTint()method 
public function RemoveTint():void

Removes any tinting applied.

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

Resets the entity to its original values.

ResetScale()method 
public function ResetScale():void

Resets the scale of the entity to defaults (1).

Respawn()method 
public function Respawn():void

Calls DeInit then Init. Resets the health and position of the entity.

Resume()method 
public function Resume():void

Resumes the display object (if it's a MovieClip/_bitmapClip and was playing)

SetAlpha()method 
public function SetAlpha(nSetAlpha:Number):void

Sets the overall transparency of the entity.

Parameters

nSetAlpha:Number

SetColor()method 
public function SetColor(newColor:uint, nAlpha:Number = 1):void

Sets the color of the entity.

Parameters

newColor:uint — The color to set to (hex).
 
nAlpha:Number (default = 1) — The alpha (transparency).

SetColorRGB()method 
public function SetColorRGB(r:int = 255, g:int = 255, b:int = 255, nAlpha:Number = 1):void

Sets the color of the entity with RGB.

Parameters

r:int (default = 255) — Red amount (0-255).
 
g:int (default = 255) — Green amount (0-255).
 
b:int (default = 255) — Blue amount (0-255).
 
nAlpha:Number (default = 1) — The alpha (transparency).

SetDisplayObject()method 
public function SetDisplayObject(dispObject:DisplayObject, bBitmap:Boolean = false, iFPS:int = 60):void

Sets the display object of the entity - i.e. the artwork.

Parameters

dispObject:DisplayObject — The display object of this entity.
 
bBitmap:Boolean (default = false) — Should we try to automatically convert to bitmap? Note: This can be very taxing on first creation, please use Velocity.bitmap.PreloadAsset before hand.
 
iFPS:int (default = 60) — The FPS of the bitmap

SetFilters()method 
public function SetFilters(... filters):void

Sets the filters of the display object.

Parameters

... filters — filters

SetFrame()method 
public function SetFrame(iFrame:int, bPlayAnim:Boolean = true):void

Sets the display object (if it's a MovieClip/BitmapClip) to a specific frame number.

Parameters

iFrame:int — The frame number to set the clip to.
 
bPlayAnim:Boolean (default = true) — Set this to false if you want the animation to not play after being set.

SetFrameLabel()method 
public function SetFrameLabel(sString:String, bPlayAnim:Boolean = true):void

Sets the display object (if it's a MovieClip/BitmapClip) to a specific labeled frame.

Parameters

sString:String — The frame label to set the movieclip to.
 
bPlayAnim:Boolean (default = true) — Set this to false if you want the animation to not play after being set.

SetRandomFrame()method 
public function SetRandomFrame(bPlayAnim:Boolean = false):void

Sets the display object (if it's a MovieClip/BitmapClip) to a random frame.

Parameters

bPlayAnim:Boolean (default = false) — Set this to true if you want the animation to play after being set.

SetRemoveTime()method 
public function SetRemoveTime(iMilliSecs:int, bFadeOut:Boolean = false, nSetFadeSpeed:Number = 0.05):void

Sets the time the entity should be removed in. Useful for bullets or timed entities.

Parameters

iMilliSecs:int — The amount of time before to object is removed (in milliseconds)
 
bFadeOut:Boolean (default = false) — If set, the entity will fade out when being removed.
 
nSetFadeSpeed:Number (default = 0.05) — The speed the entity will fade out at.

SetRotation()method 
public function SetRotation(iRot:int):void

Sets the rotation of the entity.

Parameters

iRot:int — Amount of rotation (0-360).

SetScale()method 
public function SetScale(nSetScale:Number):void

Sets the scale of the entity. WARNING: BitmapClips will render slower!

Parameters

nSetScale:Number — The scale to scale the entity to (this effects both X and Y scales).

SetTint()method 
public function SetTint(amount:Number, newColor:uint):void

Sets the tint of the entity.

Parameters

amount:Number — The amount of tint to apply.
 
newColor:uint — The color of the tint (hex).

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

Sets the tint of the entity with RGB.

Parameters

amount:Number — The amount of tint to apply.
 
r:int (default = 255) — Red amount (0-255).
 
g:int (default = 255) — Green amount (0-255).
 
b:int (default = 255) — Blue amount (0-255).

SetupCollision()method 
public function SetupCollision():void

Sets up the collision bounds.

Spawn()method 
public function Spawn(sSetLayer:String, bSpawnOnBottom:Boolean = false):void

Spawns the entity into a layer and calls Init. This is required to display the artwork. You can only call this function once. To swap layers, use the SwapLayer function.

Parameters

sSetLayer:String — The name of the layer to insert the entity in.
 
bSpawnOnBottom:Boolean (default = false) — Should the entity spawn on the bottom or on the top?

Stop()method 
public function Stop():void

Stops the display object (if it's a MovieClip/_bitmapClip)

SwapLayer()method 
public function SwapLayer(sSetLayer:String, bSpawnOnBottom:Boolean = false):void

Swaps the current layer of the entity. Must be spawned already!

Parameters

sSetLayer:String — The layer to swap this entity to.
 
bSpawnOnBottom:Boolean (default = false) — Should the entity spawn on the bottom or on the top?