API Docs for: 1.4.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:

Item Index

Properties

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:

"Component"

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 deprecated public

The state of this component.

Default: false

game

Kiwi.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

state

Kiwi.State public

Defined in src\core\Component.ts:56

Available since 1.3.1

The state which this component's owner belongs to.