API Docs for: 1.4.0
Show:

Kiwi.IChild Class

Defined in: src\core\IChild.ts:9
Module: Kiwi

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.

Methods

addTag

(
  • tag
)
public

Defined in src\core\IChild.ts:268

Available since 1.1.0

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]
)
public

Call this to clean up the object for deletion and garbage collection.

Parameters:

  • [immediate=false] Boolean optional

    If the object should be immediately removed or if it should be removed at the end of the next update loop.

hasTag

(
  • tag
)
public

Defined in src\core\IChild.ts:286

Available since 1.1.0

Checks to see if this IChild has a Tag based upon a string which you pass.

Parameters:

  • tag String

objType

() public

Defined in src\core\IChild.ts:295

Available since 1.1.0

Describes the type of this object.

Returns:

string

removeTag

(
  • tag
)
public

Defined in src\core\IChild.ts:277

Available since 1.1.0

Removes a Tag from this IChild.

Parameters:

  • tag String

render

(
  • camera
)
deprecated public

Defined in src\core\IChild.ts:19

Deprecated: Only Kiwi.Entity and inheritors are rendered.

Renders the entity.

Parameters:

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

Defined in src\core\IChild.ts:242

Available since 1.1.0

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

Defined in src\core\IChild.ts:251

Available since 1.1.0

The anchor point offset of this object on the Y axis. This is an alias of the rotPointY property on the transform.

components

Kiwi.ComponentManager public

The Component Manager

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.

game

Kiwi.Game public

The game this object belongs to

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

Defined in src\core\IChild.ts:224

Available since 1.1.0

The rotation offset of this object on the X axis. This is just aliased to the transform property.

rotPointY

Number public

Defined in src\core\IChild.ts:233

Available since 1.1.0

The rotation offset of this object on the Y axis. This is just aliased to the transform property.

scale

Number public

Defined in src\core\IChild.ts:215

Available since 1.1.0

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.

state

Kiwi.State public

The State that this object belongs to

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

Defined in src\core\IChild.ts:129

Available since 1.0.1

Controls whether this object's render methods are called by its parent.

willRender

Boolean deprecated public

Defined in src\core\IChild.ts:119

Deprecated: Use visible instead

Controls whether this object's render methods are called by its parent.

worldX

Number public

Defined in src\core\IChild.ts:173

Available since 1.1.0

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

Defined in src\core\IChild.ts:182

Available since 1.1.0

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.