Class Index | File Index

Classes


Class VENISON.ENTITY.GameEntity

The core game entity, which really is only a structure to maintain a set of properties and their corresponding attributes.
Defined in: venison_engine.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Field Summary
Field Attributes Field Name and Description
 
The attributes that this entity has been given by its attached properties.
 
The HTML image element that is used to display this entity.
 
id
The unique ID of this entity, to be set by the VENISON.ENTITY.EntityManager upon registration.
 
The transformation of this entity, in world space, describing its position, rotation and scale.
Method Summary
Method Attributes Method Name and Description
 
fnAttachProperty(iProperty)
Attaches a property to this entity, and makes the property aware of it by calling its fnAttachToEntity() method.
 
Get the unique name of this entity.
 
Get all properties currently attached to this entity.
 
fnRegisterForMessage(iProperty, iMessageType)
Called from a descendant of VENISON.PROPERTY.Property in order to register itself to receive messages of a certain type.
 
fnRemoveProperty(iPropertyName)
Remove a property from the entity.
 
fnSetName(iName)
Set the name of this entity.
Class Detail
VENISON.ENTITY.GameEntity()
Field Detail
{Object} attributes
The attributes that this entity has been given by its attached properties.

{Image} graphicsImage
The HTML image element that is used to display this entity. It is initialized by the GraphicsProperty, but feel free to point it to another image element (possibly created using document.createElement('img')) at will to change the looks of the entity. Just keep in mind that the physics shapes will not be affected at all.

{Number} id
The unique ID of this entity, to be set by the VENISON.ENTITY.EntityManager upon registration. NOTE: Use to identify the entity, but NEVER ALTER!

{VENISON.UTILITIES.Transformation} transformation
The transformation of this entity, in world space, describing its position, rotation and scale.
NOTE: Don't set this explicitly! To change an entitys transformation, use the following messages:
'setPosition' (content = {x: Number, y: Number}) to set the entity's position.
'setRotation' (content = Number) to set the entity's rotation (that is, its angle - not it's angular velocity).
'setScale' (content = {x: Number, y: Number}) to set the entity's scale in both axes
Method Detail
fnAttachProperty(iProperty)
Attaches a property to this entity, and makes the property aware of it by calling its fnAttachToEntity() method. NOTE: There will be no indiciation if a similar property is already attached to the entity, but if that is the case, strange things may happen. You have been warned.
Parameters:
{VENISON.PROPERTY.Property} iProperty
The instanciated property to attach to this entity.

{String} fnGetName()
Get the unique name of this entity.
Returns:
{String} The unique name of this entity.

{Array} fnGetProperties()
Get all properties currently attached to this entity.
Returns:
{Array} An array containing references (so be careful) to all properties currently attached to this entity.

fnRegisterForMessage(iProperty, iMessageType)
Called from a descendant of VENISON.PROPERTY.Property in order to register itself to receive messages of a certain type.
Parameters:
{VENISON.PROPERTY.Property} iProperty
The property to register to receive messages of a certain type.
{String} iMessageType
The type of messages that the property should receive.

{Boolean} fnRemoveProperty(iPropertyName)
Remove a property from the entity.
Parameters:
{String} iPropertyName
The name of the property to remove.
Returns:
{Boolean} true if the property was found and removed, false if no property with the given name was found.

{Boolean} fnSetName(iName)
Set the name of this entity.
Parameters:
{String} iName
Returns:
{Boolean} true if the name was set, false if the name was taken and hence not set.

Documentation generated by JsDoc Toolkit 2.4.0 on Thu May 05 2011 18:47:28 GMT+0200 (CEST)