API Docs for: 1.0.0
Show:

Kiwi.Component Class

Module: Kiwi

The base class that all components extend from. It contains all of the common functionality that is required of every Component. Any object

Constructor

Kiwi.Component

(
  • owner
  • componentName
)
Kiwi.Component

Parameters:

  • owner Object

    The object that this component belongs to.

  • componentName String

    The name of this component.

Returns:

Methods

destroy

() public

Destroys this component and all of the properties that exist on it.

objType

() String public

Returns the type of this object

Returns:

String:

The type of this object

postUpdate

() public

Components can postUpdate, that is run an update after the parent has updated. This is to be overriden by subclasses.

preUpdate

() public

Components can preUpdate, that is update before the parent updates. This is to be overriden by subclasses.

update

() public

If the component is being added to a State rather than a Game Object then over-ride its update method to perform required tasks.

Properties

active

Boolean public

An active Component is one that has its update method called by its parent.

Default: true

dirty

Boolean public

The state of this component.

Default: false

game

Game public

The game this Component belongs to

name

String public

The name of this component.

owner

Object public

The object that owns this entity