Package | verlocity.ents |
Class | public class DisplayEntity |
Inheritance | DisplayEntity DynamicEntity Entity Object |
Subclasses | Effect, Pickup, ScreenEffect |
Property | Defined 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 | ||
collisionRect : 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 | ||
defaultHealth : 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 | ||
_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 | ||
health : 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 | ||
_id : int
Returns the registration ID of the entity. | Entity | ||
initX : Number [read-only]
A getter that returns the initial X position. | DynamicEntity | ||
initY : Number [read-only]
A getter that returns the initial Y position. | DynamicEntity | ||
maxHealth : int
A getter that returns the maximum health this entity can have. | Entity | ||
parent : DisplayObjectContainer [read-only]
Returns the parent display object container. | DisplayEntity | ||
phys : 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 |
Property | Defined By | ||
---|---|---|---|
bCollisionEnabled : 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 | ||
iBoundPadding : int = 100 | DynamicEntity | ||
iCollisionFlags : int | DynamicEntity | ||
iRemoveOffScreenPadding : int = 100 | DynamicEntity | ||
lLayer : Layer | DisplayEntity | ||
nAlpha : Number = 1 | DisplayEntity | ||
nInitialX : Number | DynamicEntity | ||
nInitialY : Number | DynamicEntity | ||
nPosX : Number | DynamicEntity | ||
nPosY : Number | DynamicEntity | ||
rectBounds : Rectangle | DynamicEntity | ||
rectCollision : CRectangle | DynamicEntity | ||
uiColor : uint | DisplayEntity |
Method | Defined 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 | ||
ClearBounds():void
Clears the boundaries of the entity. | DynamicEntity | ||
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 | ||
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 | ||
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 | ||
EnableCollision(bEnable:Boolean = true):void
Enables/disables calculations for collision. | DynamicEntity | ||
EnablePhysics(bEnable:Boolean = true, bRemovePhysicsObj:Boolean = true):void
Enables/disables calculations for physics. | DynamicEntity | ||
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 | ||
GetClass():Object
Returns the class of the entity. | Entity | ||
GetColor():uint
Returns the color of the entity. | DisplayEntity | ||
GetMouseRotation():Number
Returns the rotation (0-360) from the relation of the mouse and the entity. | DynamicEntity | ||
GetOwner():Object
Returns the current owner of the entity. | Entity | ||
Returns the physics object
| DynamicEntity | ||
GetPos():Point
Returns the current position as a point
| DynamicEntity | ||
GetScale():Number
Returns the current scale of the entity. | DisplayEntity | ||
GetType():String
Returns the current string type of the entity. | Entity | ||
HasEnded():Boolean
Returns if the MovieClip/_bitmapClip
| DisplayEntity | ||
HasMoved():Boolean
Returns if the entity has moved (determined by its previous position set)
This is used to optimize collision and physics calculations
| DynamicEntity | ||
Init():void
Called when the entity is first registered/spawned. | Entity | ||
Is(cClass:Class):Boolean
Returns if the entity matches a class. | Entity | ||
IsBeingRemoved():Boolean
Returns if the entity is being fade removed. | DisplayEntity | ||
IsColliding(ent:DynamicEntity):Boolean
Returns the method of basic collision between other types
| DynamicEntity | ||
IsCollisionEnabled():Boolean
Returns if collision is enabled
| DynamicEntity | ||
IsCollisionFlagOn(iCollisionFlag:int):Boolean
Returns if a collision flag is enabled or not. | DynamicEntity | ||
IsDead():Boolean
Returns if the entity is dead. | Entity | ||
IsHealthZero():Boolean
Returns if the health is zero. | Entity | ||
IsOnBottomBoundary():Boolean | DynamicEntity | ||
IsOnBoundary():Boolean | DynamicEntity | ||
IsOnLeftBoundary():Boolean | DynamicEntity | ||
IsOnRightBoundary():Boolean | DynamicEntity | ||
IsOnScreen():Boolean
Returns if the entity is within the boundaries of the screen. | DynamicEntity | ||
IsOnTopBoundary():Boolean | DynamicEntity | ||
IsOnXBoundary():Boolean | DynamicEntity | ||
IsOnYBoundary():Boolean | DynamicEntity | ||
IsPhysicsEnabled():Boolean
Returns if physics is enabled
| DynamicEntity | ||
IsPlaying():Boolean
Returns if the display object (if it's a MovieClip/_bitmapClip) is currently playing
| DisplayEntity | ||
IsProtected():Boolean
Returns if the entity is protected. | Entity | ||
IsSpawned():Boolean
Returns if the entity was spawned. | DisplayEntity | ||
IsT(sCheckType:String):Boolean
Returns if the entity is matches a type (lowercase only). | Entity | ||
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 | ||
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 | ||
Remove():void
Marks the entity for removal. | Entity | ||
RemoveAllColorProperties():void
Removes the color transforms, tinting, and alpha changes applied to the entity. | DisplayEntity | ||
RemoveAllHealth():void
Removes all health of the entity. | Entity | ||
removeChild(disp:DisplayObject):void
Removes a child display object
| DisplayEntity | ||
RemoveDisplay():void
Removes all displays of the entity. | DisplayEntity | ||
RemoveDrawableBitmap():void
Removes the bitmap drawable, if it exists. | DisplayEntity | ||
RemoveFilters():void
Removes the filters of the display object
| DisplayEntity | ||
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 | ||
ResetHealth():void
Resets the entity's health to the default health. | Entity | ||
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 | ||
SetBounds(rectSetBounds:Rectangle, iInnerPadding:int = 0):void
Sets the screen boundaries of the entity. | DynamicEntity | ||
SetCollisionFlags(iFlags:int):void
Set collision flags. | DynamicEntity | ||
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 | ||
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 | ||
SetHealth(newHealth:int):void
Sets the health value of this entity. | Entity | ||
SetOwner(newOwner:Object):void
Sets the owner of the entity. | Entity | ||
SetPhysicsProperties(nMass:Number, pVelocityDirection:Point, nVelocityMagnitude:Number):void
Sets the physicial properies of this entity
| DynamicEntity | ||
SetPos(nSetPosX:Number, nSetPosY:Number):void
Sets the X and Y position of the entity
| DynamicEntity | ||
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 | ||
SetType(sSetType:String):void
Sets the string type of the entity. | Entity | ||
SetupCollision():void
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 | ||
StopAllSounds():void
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 | ||
TakeDamage(iDamageAmount:int):void
Subtracts the current health. | Entity | ||
Update():void
Called each engine tick. | Entity |
Method | Defined By | ||
---|---|---|---|
CalcXBoundaries(nSetPosX:Number):void
Calculates if a position is beyond the Y boundaries
| DynamicEntity | ||
CalcYBoundaries(nSetPosY:Number):void
Calculates if a position is beyond the Y boundaries
| DynamicEntity | ||
DrawCollisionRect():void | DynamicEntity | ||
OnDeath():void
Called when the entity's health is now 0. | Entity | ||
OnHealthChanged():void
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 | ||
OnTakeDamage():void
Called when the entity took damage via TakeDamage function. | Entity | ||
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 |
_bitmap | property |
protected var _bitmap:Bitmap
_bitmapData | property |
protected var _bitmapData:BitmapData
_bitmapDataRect | property |
protected var _bitmapDataRect:Rectangle
_bitmapDrawRect | property |
protected var _bitmapDrawRect:Rectangle
_display | property |
_display:Boolean
[read-only] [override] Returns if this entity base contains display functionality (will not Init until spawned).
public function get _display():Boolean
absX | property |
absX:Number
[read-only] [override] Returns the absolute X position.
public function get absX():Number
absY | property |
absY:Number
[read-only] [override] Returns the absolute Y position.
public function get absY():Number
baseClass | property |
baseClass:Object
[read-only] [override] Returns the entity base class.
public function get baseClass():Object
bIsBeingRemoved | property |
protected var bIsBeingRemoved:Boolean
bIsSpawned | property |
protected var bIsSpawned:Boolean
bitmapClip | property |
bitmapClip:BitmapClip
[read-only] Returns the bitmap clip of the entity.
public function get bitmapClip():BitmapClip
bounds | property |
bounds:Rectangle
[read-only] Returns the bounds of the display entity
public function get bounds():Rectangle
ctColor | property |
protected var ctColor:ColorTransform
cTint | property |
protected var cTint:Color
currentFrame | property |
currentFrame:int
[read-only] Gets the current frame of the display object (if it's a MovieClip/_bitmapClip)
public function get currentFrame():int
currentFrameLabel | property |
currentFrameLabel:String
[read-only] Gets the current frame label of the display object (if it's a MovieClip)
public function get currentFrameLabel():String
currentLayer | property |
currentLayer:Layer
[read-only] A getter that returns the layer the entity is currently in.
public function get currentLayer():Layer
currentLayerName | property |
currentLayerName:String
[read-only] A getter that returns the layer name the entity is currently in.
public function get currentLayerName():String
displayObj | property |
displayObj:DisplayObject
[read-only] Returns the display object of the entity.
public function get displayObj():DisplayObject
displayType | property |
displayType:Class
[read-only] Returns the display type class
public function get displayType():Class
graphics | property |
graphics:Graphics
[read-only] Returns the graphics object. Works for: DisplayObject
public function get graphics():Graphics
halfHeight | property |
halfHeight:Number
[read-only] A getter that returns the height divided by two (center of y).
public function get halfHeight():Number
halfWidth | property |
halfWidth:Number
[read-only] A getter that returns the width divided by two (center of x).
public function get halfWidth():Number
height | property |
height:Number
Returns the height of the display entity.
public function get height():Number
public function set height(value:Number):void
lLayer | property |
protected var lLayer:Layer
nAlpha | property |
protected var nAlpha:Number = 1
parent | property |
parent:DisplayObjectContainer
[read-only] Returns the parent display object container. Works for: DisplayObject
public function get parent():DisplayObjectContainer
rotation | property |
rotation:Number
Returns the rotation of the display entity
public function get rotation():Number
public function set rotation(value:Number):void
scaleX | property |
scaleX:Number
Returns the X scale of the display entity.
public function get scaleX():Number
public function set scaleX(value:Number):void
scaleY | property |
scaleY:Number
Returns the Y scale of the display entity.
public function get scaleY():Number
public function set scaleY(value:Number):void
sourceClass | property |
sourceClass:Class
[read-only] Returns the artwork source class name
public function get sourceClass():Class
totalFrames | property |
totalFrames:int
[read-only] Gets the total frames of the display object (if it's a MovieClip/_bitmapClip)
public function get totalFrames():int
uiColor | property |
protected var uiColor:uint
width | property |
width:Number
Returns the width of the display entity.
public function get width():Number
public function set width(value:Number):void
x | property |
x:Number
[override] Sets the position of the display entity. Works for: DisplayObject, BitmapClip
public function get x():Number
public function set x(value:Number):void
y | property |
y:Number
[override] Sets the position of the display entity. Works for: DisplayObject, BitmapClip
public function get y():Number
public function set y(value:Number):void
_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
|
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.
ReturnsNumber —
|
GetAngle | () | method |
public function GetAngle():Point
Returns the angle of rotation as a unit vector.
ReturnsPoint |
GetColor | () | method |
public function GetColor():uint
Returns the color of the entity. Requires SetColor to be called first. Defaults to white (0xFFFFFF).
Returnsuint |
GetScale | () | method |
public function GetScale():Number
Returns the current scale of the entity.
ReturnsNumber |
HasEnded | () | method |
public function HasEnded():Boolean
Returns if the MovieClip/_bitmapClip
ReturnsBoolean —
|
IsBeingRemoved | () | method |
public function IsBeingRemoved():Boolean
Returns if the entity is being fade removed.
ReturnsBoolean —
|
IsPlaying | () | method |
public function IsPlaying():Boolean
Returns if the display object (if it's a MovieClip/_bitmapClip) is currently playing
ReturnsBoolean |
IsSpawned | () | method |
public function IsSpawned():Boolean
Returns if the entity was spawned.
ReturnsBoolean |
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?
|