API Docs for: 0.5.5
Show:

kick.scene.Component Class

This class only specifies the interface of a component.

Methods

activated

()

Abstract method called when a component is added to scene. May be undefined.
This method method works in many cases like a constructor function, where references to other game objects can be looked up (this cannot be done when the actual constructor function is called, since the scene may not be loaded completely).
Note that activated are called just after update methods on all components has been called - this makes it easier to get references to other components.

deactivated

()

Abstract method called when a component is removed from scene. May be undefined.

render

(
  • engineUniforms
  • [overwriteMaterial]
)

Abstract method called every at every rendering of the object. May be undefined.

Parameters:

toJSON

() Object

Creates a JSON version of the configuration of the class. May be undefined, if so the kick.core.Util.componentToJSON() are used for serializing of the component.
Note that references to assets, gameObjects or other components should be wrapped by the kick.core.Util.getJSONReference() method

Returns:

Object:

update

()

Abstract method called every update. May be undefined.

Properties

aabb

kick.math.Aabb

Defines the axis aligned bounding box used for view frustum culling May be undefined or null.

componentType

String final

Optional name of the component type. If specified, the component can be accessed directly from the gameObject. If multiple components with same component type is added to the same gameObject, the access through gameObject is undefined

Example:

 // kick.scene.Transform has the type 'transform'
 var transform = gameObject.transform;

gameObject

kick.scene.GameObject

The gameObject owning the component. Initially undefined. The value is set when the Component object is added to a GameObject

renderOrder

Number

Default value is 1000
< 1999 default geometry
1999 skybox
2001 - 2999 transparent geometry (sorted back-to-front when rendered)
> 3000 overlay geometry rendered on top

scriptPriority

Number

Components with largest priority are invoked first. (optional - default 0). Cannot be modified after creation.

Events

componentUpdated

Fire events when components are updated. May be undefined. Must be defined before adding to gameObject.

Event Payload: