Constructor
new Actor($stage)
- Description:
- Source:
Example
class ActorExample extends Actor {}
Parameters:
| Name |
Type |
Description |
$stage |
Stage
|
The stage on which to create the actor. |
Members
- Description:
- Source:
Gets the collider.
Type:
- Description:
- Source:
Gets the current engine.
Type:
- Description:
- Source:
Gets the followers.
Type:
identifier :string
- Description:
- Source:
Gets the identifier.
Type:
label :string
- Description:
- Source:
Gets the label.
Type:
mimics :Map.<Actor, TypeMimicDeltas>
- Description:
- Source:
Gets the mimics.
Type:
-
Map.<Actor, TypeMimicDeltas>
sounds :Array.<Sound>
- Description:
- Source:
Gets the sounds.
Type:
- Description:
- Source:
Gets the sprite.
Type:
- Description:
- Source:
Gets the current stage.
Type:
- Description:
- Source:
Gets the position.
Type:
uuid :string
- Description:
- Source:
Gets the uuid.
Type:
vibrations :Array.<Vibration>
- Description:
- Source:
Gets the vibrations.
Type:
visible :boolean
- Description:
- Source:
Gets the visible status.
Type:
zIndex :number
- Description:
- Source:
Gets the z-index.
Type:
Methods
(protected) $setListener($action, $handler) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$action |
TypeGenericAction
|
The action to listen. |
$handler |
TypeListenerAction
|
The listener to set. |
Returns:
-
Type
-
this
(protected) $trigger($state) → {this}
- Description:
- Triggers a changing state on listeners.
- Source:
Parameters:
| Name |
Type |
Description |
$state |
TypeGenericState
|
The changing state to trigger. |
Returns:
-
Type
-
this
addListener($state, $handler) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$state |
TypeGenericState
|
The state to listen. |
$handler |
TypeListenerState
|
The listener to add. |
Returns:
-
Type
-
this
addSound($sound) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$sound |
Sound
|
The sound to add. |
Returns:
-
Type
-
this
addVibration($vibration) → {this}
- Description:
- Adds the given vibration.
- Source:
Parameters:
| Name |
Type |
Description |
$vibration |
Vibration
|
The vibration to add. |
Returns:
-
Type
-
this
follow($actor) → {this}
- Description:
- Follows the position of the given actor.
- Source:
Parameters:
| Name |
Type |
Description |
$actor |
Actor
|
The actor to follow the position. |
Returns:
-
Type
-
this
getComponent($name) → {any}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$name |
string
|
The name of the component to get. |
Returns:
-
Type
-
any
hasCollider() → {boolean}
- Description:
- Checks if the actor has a collider.
- Source:
Returns:
-
Type
-
boolean
hasComponent($name) → {boolean}
- Description:
- Checks if the actor has the given component.
- Source:
Parameters:
| Name |
Type |
Description |
$name |
string
|
The name of the component to check. |
Returns:
-
Type
-
boolean
hasSprite() → {boolean}
- Description:
- Checks if the actor has a sprite.
- Source:
Returns:
-
Type
-
boolean
mimic($actor) → {this}
- Description:
- Mimics the properties of the given actor.
- Source:
Parameters:
| Name |
Type |
Description |
$actor |
Actor
|
The actor to mimic the properties. |
Returns:
-
Type
-
this
onAfterRemove()
- Description:
- Called just after removing the actor.
- Source:
onBeforeRemove()
- Description:
- Called just before removing the actor.
- Source:
onCollide($parameters)
- Description:
- Called when a collision is being resolved.
- Source:
Parameters:
| Name |
Type |
Description |
$parameters |
object
|
The given parameters. |
$parameters.$actor |
Actor
|
The colliding actor. |
$parameters.$east |
boolean
|
If the origin of collision is facing the east face. |
$parameters.$north |
boolean
|
If the origin of collision is facing the north face. |
$parameters.$south |
boolean
|
If the origin of collision is facing the south face. |
$parameters.$west |
boolean
|
If the origin of collision is facing the west face. |
onCollideEnter($parameters)
- Description:
- Called when a collision is being entered.
- Source:
Parameters:
| Name |
Type |
Description |
$parameters |
object
|
The given parameters. |
$parameters.$actor |
Actor
|
The colliding actor. |
$parameters.$east |
boolean
|
If the origin of collision is facing the east face. |
$parameters.$north |
boolean
|
If the origin of collision is facing the north face. |
$parameters.$south |
boolean
|
If the origin of collision is facing the south face. |
$parameters.$west |
boolean
|
If the origin of collision is facing the west face. |
onCollideLeave($actor)
- Description:
- Called when a collision is being left.
- Source:
Parameters:
| Name |
Type |
Description |
$actor |
Actor
|
The colliding actor. |
onCreate()
- Description:
- Called when the actor is being created.
- Source:
onSetVisible($visible)
- Description:
- Called when the visible status is being set.
- Source:
Parameters:
| Name |
Type |
Description |
$visible |
boolean
|
The visible status set. |
onSetZIndex($zIndex)
- Description:
- Called when the z-index is being set.
- Source:
Parameters:
| Name |
Type |
Description |
$zIndex |
number
|
The z-index set. |
onSoundFinish($sound)
- Description:
- Called when a sound is finishing playing.
- Source:
Parameters:
| Name |
Type |
Description |
$sound |
Sound
|
The sound. |
onTick($timetick)
- Description:
- Called when the actor is being updated by one tick update.
- Source:
Parameters:
| Name |
Type |
Description |
$timetick |
number
|
The tick duration (in ms). |
onTranslate($vector)
- Description:
- Called when the actor is being translated.
- Source:
Parameters:
| Name |
Type |
Description |
$vector |
Vector2
|
The translation applied. |
removeCollider() → {this}
- Description:
- Source:
Returns:
-
Type
-
this
removeComponent($name) → {this}
- Description:
- Removes the given component.
- Source:
Parameters:
| Name |
Type |
Description |
$name |
string
|
The name of the component to remove. |
Returns:
-
Type
-
this
removeSound($sound) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$sound |
Sound
|
The sound to remove. |
Returns:
-
Type
-
this
removeSounds() → {this}
- Description:
- Source:
Returns:
-
Type
-
this
removeSprite() → {this}
- Description:
- Source:
Returns:
-
Type
-
this
removeVibration($vibration) → {this}
- Description:
- Removes the given vibration.
- Source:
Parameters:
| Name |
Type |
Description |
$vibration |
Vibration
|
The vibration to remove. |
Returns:
-
Type
-
this
removeVibrations() → {this}
- Description:
- Source:
Returns:
-
Type
-
this
setCollider($collider) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$collider |
Collider
|
The collider to set. |
Returns:
-
Type
-
this
setComponent($name, $component) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$name |
string
|
The name of the component to set. |
$component |
any
|
The value of the component to set. |
Returns:
-
Type
-
this
setIdentifier($identifier) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$identifier |
string
|
The identifier to set. |
Returns:
-
Type
-
this
setLabel($label) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$label |
string
|
The label to set. |
Returns:
-
Type
-
this
setSprite($sprite) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$sprite |
Sprite
|
The sprite to set. |
Returns:
-
Type
-
this
setVisible($visible) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$visible |
boolean
|
The visible status to set. |
Returns:
-
Type
-
this
setZIndex($zIndex) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$zIndex |
number
|
The z-index to set. |
Returns:
-
Type
-
this
translate($vector) → {this}
- Description:
- Translates the actor in the world space from a third person point of view.
- Source:
Parameters:
| Name |
Type |
Description |
$vector |
Vector2
|
The translation to apply. |
Returns:
-
Type
-
this
translateTo($vector) → {this}
- Description:
- Translates the actor in the world space to the given position.
- Source:
Parameters:
| Name |
Type |
Description |
$vector |
Vector2
|
The position to translate to. |
Returns:
-
Type
-
this
translateX($x) → {this}
- Description:
- Translates the actor in the world space from a third person point of view on the x-axis.
- Source:
Parameters:
| Name |
Type |
Description |
$x |
number
|
The translation to apply on the x-axis. |
Returns:
-
Type
-
this
translateY($y) → {this}
- Description:
- Translates the actor in the world space from a third person point of view on the y-axis.
- Source:
Parameters:
| Name |
Type |
Description |
$y |
number
|
The translation to apply on the y-axis. |
Returns:
-
Type
-
this
trigger($action) → {this}
- Description:
- Source:
Parameters:
| Name |
Type |
Description |
$action |
TypeGenericAction
|
The action to trigger. |
Returns:
-
Type
-
this
unfollow($actor) → {this}
- Description:
- Unfollows the position of the given actor.
- Source:
Parameters:
| Name |
Type |
Description |
$actor |
Actor
|
The actor to unfollow the position. |
Returns:
-
Type
-
this
unmimic($actor) → {this}
- Description:
- Unmimics the properties of the given actor.
- Source:
Parameters:
| Name |
Type |
Description |
$actor |
Actor
|
The actor to unmimic the properties. |
Returns:
-
Type
-
this
Type Definitions
(protected) TypeListenerAction($action)
- Source:
Parameters:
| Name |
Type |
Description |
$action |
TypeGenericAction
|
The action to listen. |
(protected) TypeListenerState($state)
- Source:
Parameters:
| Name |
Type |
Description |
$state |
TypeGenericState
|
The state to listen. |
TypeMimicDeltas
- Description:
- A list of relative delta properties.
- Source:
Properties:
| Name |
Type |
Description |
$deltaTranslation |
Vector2
|
The delta translation. |
$deltaZIndex |
number
|
The delta z-index. |
A list of relative delta properties.
Type: