Kiwi.IChild Class
A IChild is an Interface (defined as a class as the documentation does not support Interfaces just yet), which outlines the methods/properties that objects which are intended to be added as a child of a Stage or Group must have in order to work. As Javascript does not use Interfaces, the IChild does not appear directly in the library. It describes common elements of Kiwi.Group and Kiwi.Entity.
Item Index
Methods
addTag
-
tag
Adds a new Tag to this IChild. Useful for identifying large amounts of the same type of GameObjects.
Parameters:
-
tag
String
childType
()
public
Represents the type of child that this is.
Returns:
number
destroy
-
[immediate=false]
Call this to clean up the object for deletion and garbage collection.
Parameters:
-
[immediate=false]
Boolean optionalIf the object should be immediately removed or if it should be removed at the end of the next update loop.
hasTag
-
tag
Checks to see if this IChild has a Tag based upon a string which you pass.
Parameters:
-
tag
String
objType
()
public
Describes the type of this object.
Returns:
string
removeTag
-
tag
Removes a Tag from this IChild.
Parameters:
-
tag
String
update
()
public
Update the entity. Automatically called every frame.
Properties
active
Boolean
public
Toggles the active state. An active object has its update method called by its parent.
anchorPointX
Number
public
The anchor point offset of this object on the X axis. This is an alias of the rotPointX property on the transform.
anchorPointY
Number
public
The anchor point offset of this object on the Y axis. This is an alias of the rotPointY property on the transform.
dirty
Boolean
public
An indication of whether or not this object is 'dirty' and thus needs to be re-rendered in some manner.
exists
Boolean
public
Toggles the exitence of this object. An object that no longer exists can be garbage collected or re-allocated in a pool This method should be over-ridden to handle specific canvas/webgl implementations.
id
String
public
Unique identifier instantiated on creation.
name
String
public
A name for this object. This is not necessary or necessarily unique, but is handy for identifying objects.
parent
Kiwi.Group
public
Sets the parent of this object. It is recommended to update transforms when you set this.
rotation
Number
public
The rotation of this object. This is just aliased to the transform property.
rotPointX
Number
public
The rotation offset of this object on the X axis. This is just aliased to the transform property.
rotPointY
Number
public
The rotation offset of this object on the Y axis. This is just aliased to the transform property.
scale
Number
public
The scale of this object. This is just aliased to the transform property.
scaleX
Number
public
The Scale X of this object. This is just aliased to the transform property.
scaleY
Number
public
The Scale Y of this object. This is just aliased to the transform property.
transform
Kiwi.Geom.Transform
public
The transform for this object. Transform handles the calculation of coordinates/rotation/scale etc in the game world.
visible
Boolean
public
Controls whether this object's render methods are called by its parent.
willRender
Boolean
deprecated
public
Controls whether this object's render methods are called by its parent.
worldX
Number
public
The X coordinate of this object in world space - that is, after inheriting transforms from parents. This is just aliased to the transform property.
worldY
Number
public
The Y coordinate of this object in world space - that is, after inheriting transforms from parents. This is just aliased to the transform property.
x
Number
public
The X coordinate of this object. This is just aliased to the transform property.
y
Number
public
The Y coordinate of this object. This is just aliased to the transform property.