Component
Component
Native component
Provides access to a native component instance of a specified component type
Kind: global class
.type ⇒ string
Kind: instance property of Component
Returns: string - the name of this component’s type
.object ⇒ Object
Kind: instance property of Component
Returns: Object - The object this component is attached to
.active
Set whether this component is active
Activating/deactivating a component comes at a small cost of reordering components in the respective component manager. This function therefore is not a trivial assignment.
Does nothing if the component is already activated/deactivated.
Kind: instance property of Component
Param | Type | Description |
---|---|---|
active | boolean | New active state |
.active ⇒ boolean
Kind: instance property of Component
Returns: boolean - Whether this component is active
.destroy ()
Remove this component from its objects and destroy it.
It is best practice to set the component to null
after,
to ensure it does not get used later.
Kind: instance method of Component
0.9.0+
Example
.equals (otherComponent) ⇒ boolean
Checks equality by comparing whether the wrapped native component ids and component manager types are equal.
Kind: instance method of Component
Returns: boolean - Whether this component equals the given component
Param | Type | Description |
---|---|---|
otherComponent | Component | Component to check equality with |