Constructor
new Entity(definitionopt, instanceDefinitionopt, callbackopt, parentopt) → {Entity}
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
definition |
Object
|
<optional> |
Base definition for the entity.
|
||||||||||||||||
instanceDefinition |
Object
|
<optional> |
Specific instance definition including properties that override the base definition properties.
|
||||||||||||||||
callback |
function
|
<optional> |
A function to run once all of the components on the Entity have been loaded. The first parameter is the entity itself. |
||||||||||||||||
parent |
Entity
|
<optional> |
Presets the parent of the entity so that the parent entity is available during component instantiation. Overrides |
Fires:
Returns:
- Type:
-
Entity
Returns the new entity made up of the provided components.
Extends
Members
destroyed :Boolean
This read-only property shows whether this Messenger is destroyed.
Properties:
Name | Type | Description |
---|---|---|
destroyed |
- Overrides:
- Default Value:
- false
- Source:
Type:
-
Boolean
Methods
(static) getAssetList(definition, properties, data) → {Array}
Returns all of the assets required for this Entity. This method calls the corresponding method on all components to determine the list of assets.
Parameters:
Name | Type | Description |
---|---|---|
definition |
Object
|
The definition for the Entity. |
properties |
Object
|
Properties for this instance of the Entity. |
data |
Object
|
Layer data that affects asset list. |
Returns:
- Type:
-
Array
A list of the necessary assets to load.
addComponent(component) → {platypus.Component}
Attaches the provided component to the entity.
Parameters:
Name | Type | Description |
---|---|---|
component |
platypus.Component
|
Must be an object that functions as a Component. |
Fires:
destroy()
This method removes all components from the entity.
- Overrides:
- Source:
getMessageIds() → {Array}
This method returns all the messages that this entity is concerned about.
- Overrides:
- Source:
Returns:
- Type:
-
Array
An array of strings listing all the messages for which this Messenger has handlers.
off(name, callback)
Remove the event listener
- Overrides:
- Source:
Parameters:
Name | Type | Description |
---|---|---|
name |
String
|
The type of event; if no name is specifed remove all listeners. |
callback |
function
|
The listener function. |
on(name, callback)
Add an event listener. The parameters for the listener functions depend on the event.
- Overrides:
- Source:
Parameters:
Name | Type | Description |
---|---|---|
name |
String
|
The type of event. |
callback |
function
|
The callback function when event is triggered. |
remove-entity(entity)
On receiving this message, the provided entity will be removed from the list of child entities.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity to remove. |
removeComponent(component) → {Component}
Removes the mentioned component from the entity.
Parameters:
Name | Type | Description |
---|---|---|
component |
Component
|
Must be a [[Component]] attached to the entity. |
Fires:
Returns:
- Type:
-
Component
Returns the same object that was submitted if removal was successful; otherwise returns false (the component was not found attached to the entity).
set-parent-render-container(entity, container)
Sets the parent render container of an entity to that of the given entity or entity with the given id.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
Object
|
The entity to relocate. |
container |
Entity
|
String
|
PIXI.Container
|
The entity, id of the entity, or PIXI.Container that will act as the parent container. |
setProperty(properties)
This method sets one or more properties on the entity.
Parameters:
Name | Type | Description |
---|---|---|
properties |
Object
|
A list of key/value pairs to set as properties on the entity. |
toJSON(includeComponents) → {Object}
Returns a JSON object describing the entity.
Parameters:
Name | Type | Description |
---|---|---|
includeComponents |
Boolean
|
Whether the returned JSON should list components. Defaults to |
Returns:
- Type:
-
Object
Returns a JSON definition that can be used to recreate the entity.
toString() → {String}
Returns a string describing the entity.
- Overrides:
- Source:
Returns:
- Type:
-
String
Returns the entity type as a string of the form "[Entity entity-type]".
trigger(event, value, debug) → {number}
This method is used by both internal components and external entities to trigger messages. When triggered, Messenger checks through bound handlers to run as appropriate. This handles multiple event structures: "", [], and {}
- Overrides:
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
String
|
Array
|
Object
|
This is the message(s) to process. This can be a string, an object containing an "event" property (and optionally a "message" property, overriding the value below), or an array of the same. |
value |
*
|
This is a message object or other value to pass along to event handler. |
debug |
boolean
|
This flags whether to output message contents and subscriber information to the console during game development. A "value" object parameter (above) will also set this flag if value.debug is set to true. |
Returns:
- Type:
-
number
The number of handlers for the triggered message.
triggerEvent(event, valueopt) → {number}
This method is used by both internal components and external entities to trigger messages on this entity. When triggered, entity checks through bound handlers to run as appropriate. This method is identical to Spring Roll's EventDispatcher.trigger, but uses alternative Array methods to alleviate excessive GC.
- Overrides:
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
event |
String
|
This is the message to process. |
|||||||||
value |
*
|
<optional> |
This is a message object or other value to pass along to event handler.
|
Returns:
- Type:
-
number
The number of handlers for the triggered message.
Events
[active-state]
Broadcasts active states using the JSON-defined message on each handle-controller
message. Active states include pressed
being true or released
being true. If both of these states are false, the message is not broadcasted.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message.pressed |
Boolean
|
Whether the current input is active. |
message.released |
Boolean
|
Whether the current input was active last tick but is no longer active. |
message.triggered |
Boolean
|
Whether the current input is active but was not active last tick. |
message.over |
Boolean
|
Whether the mouse was over the entity when pressed, released, or triggered. This value is always false for non-mouse input messages. |
accelerate
Changes the velocity of the Entity when in motion.
Parameters:
Name | Type | Description |
---|---|---|
velocity |
Number
|
platypus.Vector
|
The magnitude or Vector to multiply the current velocity by. |
Listeners of This Event:
add-collision-entity
On receiving 'collide-on', this message is triggered on the parent to turn on collision.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity this component is attached to. |
Listeners of This Event:
add-entity
This message will added the given entity to this component's list of entities.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
entity |
platypus.Entity
|
This is the entity to be added as a child. |
|
callback |
function
|
<optional> |
A function to run once all of the components on the Entity have been loaded. |
Listeners of This Event:
add-node
Expects a node definition to create a node in the NodeMap.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
definition |
Object
|
Key/value pairs.
|
Listeners of This Event:
add-remove-component-complete
This message is triggered on the entity itself when its components change.
- Source:
add-tiles
This event adds a layer of tiles to render on top of the existing layer of rendered tiles.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message.imageMap |
Array
|
This is a 2D mapping of tile indexes to be rendered. |
Listeners of This Event:
animation-ended
This event fires each time an animation completes.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
animation |
String
|
The id of the animation that ended. |
Listeners of This Event:
append-transform
This message performs an immediate transform of the entity by performing the transformation via an appended matrix multiplication.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
transform |
Array
|
String
|
A 3x3 @D Array or a string describing a transformation. |
Listeners of This Event:
attach
Creates and attaches the entity. The input value makes it possible to attach the entity on user input.
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
input |
Object
|
An input object.
|
Listeners of This Event:
blocked
This message is triggered if the entity collides while racing.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
collision |
platypus.CollisionData
|
Collision information from the entity or tile that blocked movement. |
cache
On receiving a "cache" event, this component triggers "cache-sprite" to cache its rendering into the background. This is an optimization for static images to reduce render calls.
- Source:
Listeners of This Event:
cache-sprite
On receiving a "cache" event, this component triggers "cache-sprite" to cache its rendering into the background. This is an optimization for static images to reduce render calls.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
This component's owner. |
Listeners of This Event:
camera-loaded
On receiving a "world-loaded" message, the camera broadcasts the world size to all children in the world.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
camera |
Object
|
|
Listeners of This Event:
camera-update
This component fires "camera-update" when the position of the camera in the world has changed. This event is triggered on both the entity (typically a layer) as well as children of the entity.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
Object
|
|
Listeners of This Event:
- platypus.components.AudioSFX
- platypus.components.HandlerLogic
- platypus.components.Interactive
- platypus.components.LogicButton
- platypus.components.LogicDragDrop
- platypus.components.RelativePosition
- platypus.components.RenderContainer
- platypus.components.RenderDebug
- platypus.components.RenderTiles
- platypus.components.TiledLoader
cancelled
This event is triggered when the button is pressed and the mouse/touch is dragged off-target before release.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttonState |
platypus.Data
|
The state of the button
|
carry-me
This message is triggered on a potential carrying peer, notifying the peer that this entity is portable.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message.entity |
platypus.Entity
|
This entity, requesting to be carried. |
Listeners of This Event:
change-attachment-offset
Changes the x, y, and z offset of the attachment.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
offset |
Object
|
An object containing the offset values. |
input.x |
Number
|
The new X offset. |
input.y |
Number
|
The new Y offset. |
input.y |
Number
|
The new Z offset. |
Listeners of This Event:
change-count
Changes the count to the given value.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
data.count |
number
|
The new count value. |
Listeners of This Event:
change-tile
This event edits the tile index of a rendered tile.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
tile |
String
|
A string representing the name of the tile to switch to. |
|
x |
Number
|
The column of the tile to edit. |
|
y |
Number
|
The row of the tile to edit. |
|
z |
Number
|
<optional> |
If RenderTiles has multiple layers, this value specifies the layer, with |
Listeners of This Event:
change-total
Changes the total to the given value.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
data.total |
number
|
The new total value. |
Listeners of This Event:
chase
This event is triggered whenever the entity begins chasing another entity or stops chasing another entity.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
chasing |
boolean
|
Whether the entity is chasing another entity. |
check-collision-group
This event is triggered on the entity (layer) to test collisions once logic has been completed.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tick |
Object
|
|
Listeners of This Event:
child-entity-added
This message is triggered when a new entity has been added to the list of children entities.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity that was just added. |
child-entity-removed
This message is triggered when an entity has been removed from the list of children entities.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity that was just added. |
child-entity-updated
This message is triggered on the parent when the entity's components change.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
This is the entity itself. |
clip-complete
When a sound effect is finished playing, this event is triggered.
- Source:
collide-off
On receiving this message, the component triggers remove-collision-entity
on the parent.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
If specified, only collision components of this type are removed from the collision list. |
Listeners of This Event:
collide-on
On receiving this message, the component triggers add-collision-entity
on the parent.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
type |
String
|
If specified, only collision components of this type are added to the collision list. |
Listeners of This Event:
complete-tweens
On receiving this message, any currently running orientation tweens are immediately completed to give the entity a new stable position.
- Source:
Listeners of This Event:
component-added
The entity triggers component-added
on itself once a component has been attached, notifying other components of their peer component.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
component |
platypus.Component
|
The added component.
|
component-removed
The entity triggers component-removed
on itself once a component has been removed, notifying other components of their peer component's removal.
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
component |
Component
|
The removed component.
|
Listeners of This Event:
control-acceleration
This event controls whether the acceleration is active or inactive.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Object
|
boolean
|
If |
Listeners of This Event:
control-velocity
This event controls whether this velocity is active or inactive.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Object
|
boolean
|
If |
Listeners of This Event:
created-level
Dispatched when the scene has loaded and the level has been composited. This occurs before "load-level" to send out level before it's loaded in case it needs to be saved or edited before being loaded.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object
|
|
destroy-me
This component will set the entity up for removal on receiving this message.
- Source:
Listeners of This Event:
detach
Detaches and removes the entity.
- Source:
Listeners of This Event:
disable
Disables the entity.
- Source:
Listeners of This Event:
dispatch-event
This event dispatches a PIXI.Event on this component's PIXI.Sprite. Useful for rerouting mouse/keyboard events.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
Object
|
PIXI.Event
|
The event to dispatch. |
Listeners of This Event:
drop-tweens
On receiving this message, any currently running orientation tweens are discarded, returning the entity to its last stable position.
- Source:
Listeners of This Event:
east
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due east.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
east-northeast
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due east-northeast.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
east-southeast
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due east-southeast.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
enable
Enables the entity.
- Source:
Listeners of This Event:
entity-created
Called when this entity spawns a new entity, this event links the newly created entity to this entity.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity to link. |
Listeners of This Event:
face
Set the direction the entity should face while stopped.
Parameters:
Name | Type | Description |
---|---|---|
direction |
String
|
A value such as "north" or "left" to point the entity in a particular direction. |
Listeners of This Event:
follow
This component fires this message on this entity's parent so the camera will begin following this entity.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
Object
|
|
Listeners of This Event:
follow-me
On receiving this message, the component will trigger a message requesting that the parent camera begin following this entity.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object
|
<optional> |
A list of key/value paris describing camera options to set.
|
Listeners of This Event:
force-release
On receiving this message, this component immediately triggers 'release-me' on its owner's carrier.
- Source:
Listeners of This Event:
go-down
Triggers this event when the entity is moving up and collides with something.
- Source:
Listeners of This Event:
go-left
Triggers this event when the entity is moving right and collides with something.
- Source:
Listeners of This Event:
go-right
Triggers this event when the entity is moving left and collides with something.
- Source:
Listeners of This Event:
go-up
Triggers this event when the entity is moving down and collides with something.
- Source:
Listeners of This Event:
handle-ai
AI components listen in order to perform their logic on each tick.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tick.delta |
Number
|
The time that has passed since the last tick as manipulated by the timeMultiplier. |
tick.gameDelta |
Number
|
The time that has passed since the last tick. Unmanipulated by timeMultiplier. Use for components that need to run on actual time. |
tick.camera |
null
|
platypus.AABB
|
The range of the logic camera area. This is typically larger than the visible camera. This value is |
tick.entities |
Array
|
This is a list of all the logically active entities. |
tick.tick |
Object
|
Tick object from "tick" event. |
Listeners of This Event:
handle-controller
Triggered on owner and child entities on each tick to handle whatever they need to regarding controls.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tick |
Object
|
An object containing tick data. |
Listeners of This Event:
handle-logic
This event is triggered on the top-level layer to signify a "handle-logic" event is about to be triggered on children, and is then subsequently triggered on all of the layer's child entities. This is unique from the layer's "tick" event in that it occurs the same number of times as the "handle-logic" event and will not occur if HandlerLogic is paused.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tick.delta |
Number
|
The time that has passed since the last tick as manipulated by the timeMultiplier. |
tick.gameDelta |
Number
|
The time that has passed since the last tick. Unmanipulated by timeMultiplier. Use for components that need to run on actual time. |
tick.camera |
null
|
platypus.AABB
|
The range of the logic camera area. This is typically larger than the visible camera. This value is |
tick.entities |
Array
|
This is a list of all the logically active entities. |
tick.tick |
Object
|
Tick object from "tick" event. |
Listeners of This Event:
- platypus.components.CollisionBasic
- platypus.components.Counter
- platypus.components.EntityContainer
- platypus.components.HandlerController
- platypus.components.LogicAngularMovement
- platypus.components.LogicAttachment
- platypus.components.LogicButton
- platypus.components.LogicDirectionalMovement
- platypus.components.LogicDragDrop
- platypus.components.LogicImpactLaunch
- platypus.components.LogicPacingPlatform
- platypus.components.LogicPortable
- platypus.components.LogicPortal
- platypus.components.LogicPushable
- platypus.components.LogicRebounder
- platypus.components.LogicRegionSpawner
- platypus.components.LogicRotationalMovement
- platypus.components.LogicSpawner
- platypus.components.LogicStateMachine
- platypus.components.LogicSwitch
- platypus.components.LogicTeleportee
- platypus.components.LogicTimer
- platypus.components.LogicWindUpRacer
- platypus.components.NodeResident
- platypus.components.Orientation
- platypus.components.RelativePosition
- platypus.components.Timeline
- platypus.components.Tutorial
- platypus.components.Tween
handle-movement
This event is triggered on children entities to move. This happens immediately after logic so entity logic can determine movement.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tick |
Object
|
|
Listeners of This Event:
handle-post-collision-logic
This event is triggered on entities to run logic that may depend upon collision responses.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tick |
Object
|
|
Listeners of This Event:
handle-render
Triggered every tick on owner and its children entities.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object
|
|
Listeners of This Event:
handle-render-load
Triggered on an entity added to the parent.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object
|
|
Listeners of This Event:
hide
This event makes the spine invisible.
- Source:
Listeners of This Event:
hide-sprite
This event makes the sprite invisible.
- Source:
Listeners of This Event:
highlight
Sets the entity's highlighted state to true
.
- Source:
Listeners of This Event:
hit-by-*
When an entity collides with an entity of a listed collision-type, this message is triggered on the entity. * is the other entity's collision-type.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
collision |
Object
|
|
Listeners of This Event:
hit-solid
On receiving this message, this component stops all velocities along the axis of the collision direction and sets "grounded" to true
if colliding with the ground.
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
collisionInfo |
Object
|
|
in-location
This event is triggered if the entity is placed on the map but not assigned a node. It is moved to the nearest node and "in-location" is triggered.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity that is in location. |
increment-count
Increments the count by 1.
- Source:
Listeners of This Event:
input-on
This event is triggered once HandlerRender is ready to handle interactivity.
- Source:
Listeners of This Event:
input-precedence-updated
Triggered on owner and child entities when player uses a new imput method. (For example, going from mouse to keyboard or keyboard to gamepad.)
- Source:
Parameters:
Name | Type | Description |
---|---|---|
inputs |
Array
|
A list of input methods, ordered by precedence with index 0 being the most recent input method. |
instant-begin
This event triggers the beginning of an instant motion.
- Source:
Listeners of This Event:
instant-end
This event triggers the end of an instant motion.
- Source:
Listeners of This Event:
instant-motion
This event triggers an instant motion.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
control |
Object
|
boolean
|
If |
Listeners of This Event:
joystick-orientation
If the soft joystick is enabled on this component, this message will trigger to provide the current orientation of the joystick.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
orientation |
(number) - A number in radians representing the orientation of the joystick. |
layer-live
This event is triggered on each newly-live layer once it is finished loading and ready to display.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object
|
A list of key-value pairs of data sent into this Scene from the previous Scene. |
layer-loaded
This event is triggered on the layers once all assets have been readied and the layer is created.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
persistentData |
Object
|
Data passed from the last scene into this one.
|
|||||||||
holds |
platypus.Data
|
An object that handles any holds on before making the scene live.
|
Listeners of This Event:
layer-unloaded
This event is triggered on the layers once the Scene is over.
level-loading-progress
As a level is loaded, this event is triggered to show progress.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
platypus.Data
|
Contains progress data.
|
link-family
Called when linking a new member to the family, this event accepts a list of family members from the new member and uses it to link all the family members together.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
links |
Array
|
Entities
|
An array of entities. |
Listeners of This Event:
load
The entity triggers load
on itself once all the properties and components have been attached, notifying the components that all their peer components are ready for messages.
load-level
Dispatched when the scene has loaded and the level has been composited so TileLoader can begin loading the level.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
data |
Object
|
|
Listeners of This Event:
logic-paused
Notifies children entities that logic has been paused.
- Source:
logic-unpaused
Notifies children entities that logic has been unpaused.
- Source:
move
Start the entity accelerating toward the heading angle.
Listeners of This Event:
mute-audio
On receiving this message all audio will mute, or a particular sound instance will mute if an id is specified.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
audioId |
String
|
If an audioId is provided, that particular sound instance will mute. Otherwise all audio is muted. |
Listeners of This Event:
new-scene
On receiving this message, a new scene is loaded according to provided parameters or previously determined component settings.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message.load |
String
|
This is a label corresponding with a predefined layer. |
message.persistentData |
Object
|
Any values that should be passed to the layers' "layer-loaded" and "layer-live" events. |
Listeners of This Event:
no-drop
This message comes from the collision system letting us know the object is currently in a location that it cannot be dropped.
- Source:
Listeners of This Event:
north
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due north.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
north-northeast
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due north-northeast.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
north-northwest
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due north-northwest.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
northeast
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due northeast.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
northwest
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due northwest.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
orient-vector
On receiving a vector via this event, the component will transform the vector using the current orientation matrix and then store the vector and continue manipulating it as the orientation matrix changes.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
vector |
platypus.Vector
|
The vector whose orientation will be maintained. |
Listeners of This Event:
orientation-updated
Once a transform is complete, this event is triggered to notify the entity of the completed transformation.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Array
|
A 3x3 2D array describing the change in orientation. |
Listeners of This Event:
pause-audio
On receiving this message all audio will pause, or a particular sound instance will pause if an id is specified.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
audioId |
String
|
If an audioId is provided, that particular sound instance will pause. Otherwise all audio is paused. |
Listeners of This Event:
pause-controls
This message will stop the controller from triggering messages until "unpause-controls" is triggered on the entity.
- Source:
Listeners of This Event:
pause-logic
This component fires this message on the parent entity to pause logic if required.
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
Object
|
|
Listeners of This Event:
pause-movment
Stops all movement on the Entity.
- Source:
Listeners of This Event:
pause-render
This component fires this message on the parent entity to pause rendering if required.
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
options |
Object
|
|
Listeners of This Event:
pause-tween
This event pauses all running tweens on this component.
- Source:
Listeners of This Event:
peer-entity-added
This message is triggered when a new entity has been added to the parent's list of children entities.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity that was just added. |
Listeners of This Event:
peer-entity-removed
This message is triggered when an entity has been removed from the parent's list of children entities.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity that was just removed. |
Listeners of This Event:
play-animation
On entering a new animation-mapped state, this component triggers this event to play an animation.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
animation |
String
|
Describes the animation to play. |
loop |
Boolean
|
Whether to loop a playing animation. |
restart |
Boolean
|
Whether to restart a playing animation. |
Listeners of This Event:
pointercancel
This event is triggered on pointer cancel.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
pointerdown
This event is triggered on pointer down.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
pointermove
This event is triggered on pointer move.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
Listeners of This Event:
pointerout
This event is triggered on pointer out.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
Listeners of This Event:
pointerover
This event is triggered on pointer over.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
Listeners of This Event:
pointertap
This event is triggered on pointer tap.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
pointerup
This event is triggered on pointer up.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
pointerupoutside
This event is triggered on pointer up outside.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
prepare-logic
This event is triggered on children entities to run anything that should occur before "handle-logic". For example, removing or adding components should happen here and not in "handle-logic".
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
tick |
Object
|
|
Listeners of This Event:
prepend-transform
This message performs an immediate transform of the entity by performing the transformation via a prepended matrix multiplication.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
transform |
Array
|
String
|
A 3x3 @D Array or a string describing a transformation. |
Listeners of This Event:
pressed
This event is triggered when the button is pressed to mimic keypress events. If the button is a toggle button, this only occurs on up-to-down.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttonState |
platypus.Data
|
The state of the button
|
pressmove
This event is triggered on press move (drag).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
Listeners of This Event:
pressup
This event is triggered on press up.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
event |
DOMEvent
|
The original DOM pointer event. |
pixiEvent |
PIXI.interaction.InteractionEvent
|
The Pixi pointer event. |
x |
Number
|
The x coordinate in world units. |
y |
Number
|
The y coordinate in world units. |
entity |
platypus.Entity
|
The entity receiving this event. |
racing
This event is triggered when winding is finished and the entity begins racing.
- Source:
release-me
This message is triggered on the current carrier, notifying them to release this entity.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message.entity |
platypus.Entity
|
This entity, requesting to be released. |
Listeners of This Event:
released
This event is triggered when the button is released, or on the down-to-up change for toggle buttons.
- Source:
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
buttonState |
platypus.Data
|
The state of the button
|
relocate
The camera listens for this event to change its position in the world.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location |
Vector
|
Object
|
List of key/value pairs describing new location
|
Listeners of This Event:
relocate-entity
This message causes the entity's x,y coordinates to update. (Usually after collision checks, but can be used to avoid collision checks during logic handling.)
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
location |
Object
|
platypus.Vector
|
The new coordinates.
|
|||||||||||||||||||||
relative |
<optional> |
If |
Listeners of This Event:
remove-collision-entity
On receiving 'collide-off', this message is triggered on the parent to turn off collision.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
The entity this component is attached to. |
Listeners of This Event:
remove-vector
On receiving this message, the maintained vector is immediately dropped from the list of maintained vectors.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
vector |
platypus.Vector
|
The vector to be removed. |
Listeners of This Event:
render-paused
Notifies children entities that rendering updates have been paused.
- Source:
render-unpaused
Notifies children entities that rendering updates have been unpaused.
- Source:
render-update
Sends a 'handle-render' message to all the children in the Container. This bypasses a render pause value and is useful for resizes happening outside the game loop.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tick |
Object
|
An object containing tick data. |
Listeners of This Event:
render-world
Once the entity is loaded, this component triggers "render-world" to notify other components about the entities' display container.
- Source:
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
data |
Object
|
|
Listeners of This Event:
replace-transform
This message performs an immediate transform of the entity by returning the entity to an identity transform before performing a matrix multiplication.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
transform |
Array
|
String
|
A 3x3 @D Array or a string describing a transformation. |
Listeners of This Event:
request
On receiving this message, this component makes a request from the server using the provided information. Note that properties set here will reset the properties set by this component's JSON definition.
Properties:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
Object
|
||||||||||||||||||||||||||||
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
method |
String
|
XHR method to use: must be "GET" or "POST". |
||
path |
String
|
The path to the server resource. |
||
responseType |
String
|
<optional> |
"text" | Response type expected. |
data |
Object
|
<optional> |
An object of string key/value pairs to be transmitted to the server. |
|
onload |
function
|
A function that should be run on receiving a response from the server. This defaults to triggering a "response" message containing the responseText value. |
- Source:
Listeners of This Event:
resize-camera
The camera listens for this event to change its world viewport size.
- Source:
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
dimensions |
Object
|
<optional> |
List of key/value pairs describing new viewport size
|
||||||||||||
forceUpdate |
Boolean
|
<optional> |
Whether to update graphics. |
Listeners of This Event:
response
This message is triggered on receiving a response from the server (if "onload" is not set by the original "request" message).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
String
|
The message contains the responseText returned by the server. |
rotate
This rotates the entity by a delta in radians.
Parameters:
Name | Type | Description |
---|---|---|
angleDelta |
Number
|
The change in angle. |
Listeners of This Event:
sequence-complete
When an audio sequence is finished playing, this event is triggered.
- Source:
Listeners of This Event:
set-angle
Sets the internal heading angle in the component.
Parameters:
Name | Type | Description |
---|---|---|
angle |
Number
|
The value you want to set the angle to. |
Listeners of This Event:
set-hit-area
Sets the hit area for interactive responses by describing the dimensions of a clickable rectangle:
"hitArea": {
"x": 10,
"y": 10,
"width": 40,
"height": 40
}
Or a circle:
"hitArea": {
"x": 10,
"y": 10,
"radius": 40
}
Or use an array of numbers to define a polygon: [x1, y1, x2, y2, ...]
"hitArea": [-10, -10, 30, -10, 30, 30, -5, 30]
Defaults to the container if set to null
.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
shape |
Object
|
Listeners of This Event:
set-mask
Defines the mask on the container/sprite. If no mask is specified, the mask is set to null.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
mask |
Object
|
The mask. This can specified the same way as the 'mask' parameter on the component. |
Listeners of This Event:
set-max-velocity
Set the max velocity.
Parameters:
Name | Type | Description |
---|---|---|
newMaxV |
Number
|
The max velocity value. |
Listeners of This Event:
set-mix-times
This sets the mix times.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
mixTimes |
Object
|
This matches the syntax required for this component's |
Listeners of This Event:
set-motion
This event modifies the properties of this Motion.
- Source:
Parameters:
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
motion |
Object
|
A list of key/value pairs corresponding to motion values.
|
Listeners of This Event:
set-mover
Update mover properties.
- Source:
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
mover |
Object
|
|
Listeners of This Event:
set-pan
This message sets the pan of playing audio.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
pan |
Number
|
A number from -1 to 1 that sets the pan. |
|
soundId |
String
|
<optional> |
If an soundId is provided, that particular sound instance's pan is set. |
Listeners of This Event:
set-persistent-scene-data
On receiving this message, persistent data is stored, waiting for a new-scene
to make the transition.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
persistentData |
Object
|
Any values that should be passed to the next scene via the "layer-loaded" and "layer-live" events. |
Listeners of This Event:
set-scene
On receiving this message, a scene value is stored, waiting for a new-scene
to make the transition.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
scene |
String
|
This is a label corresponding with a predefined scene. |
Listeners of This Event:
set-speed
This message sets the speed of playing audio.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
speed |
Number
|
A number that sets the speed. |
|
soundId |
String
|
<optional> |
If an soundId is provided, that particular sound instance's speed is set. Otherwise all audio speed is changed. |
Listeners of This Event:
set-target
On receiving this message, the component will change its target and begin chasing the new entity.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
entity |
platypus.Entity
|
Sets this entity's target to the provided entity. |
Listeners of This Event:
set-target-offset
On receiving this message, the component will change its target offset.
- Source:
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
offset |
Object
|
Vector
|
Sets the chased entity's offset to the provided offset.
|
Listeners of This Event:
set-text
Sets the copy of the text.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
text |
String
|
The text to insert. |
Listeners of This Event:
set-timer
Sets time for alarm.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
data.time |
Number
|
Time to set for alarm. |
Listeners of This Event:
set-volume
This message sets the volume of playing audio.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
volume |
Number
|
A number from 0 to 1 that sets the volume. |
|
soundId |
String
|
<optional> |
If an soundId is provided, that particular sound instance's volume is set. Otherwise all audio volume is changed. |
Listeners of This Event:
shake
On receiving this message, the camera will shake around its target location.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
shake |
Object
|
|
Listeners of This Event:
show
This event makes the spine visible.
- Source:
Listeners of This Event:
show-sprite
This event makes the sprite visible.
- Source:
Listeners of This Event:
south
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due south.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
south-southeast
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due south-southeast.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
south-southwest
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due south-southwest.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
southeast
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due southeast.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
southwest
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due southwest.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
start-acceleration
This event sets the acceleration to active.
- Source:
Listeners of This Event:
start-chasing
On receiving this message, the component will begin chasing the entity.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
entity |
platypus.Entity
|
<optional> |
Sets the entity if it's provided. |
Listeners of This Event:
start-timer
Starts the timer's countdown.
- Source:
Listeners of This Event:
start-velocity
This event sets the velocity to active.
- Source:
Listeners of This Event:
state-changed
Triggered on entities when the entity's state has been changed.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
state |
Object
|
A list of key/value pairs representing the owner's state (this value equals |
stop
Stops motion in all directions until movement messages are again received.
- Source:
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
message.pressed |
boolean
|
<optional> |
If |
stop-acceleration
This event sets the acceleration to inactive.
- Source:
Listeners of This Event:
stop-active-timelines
Stops all timelines.
- Source:
Listeners of This Event:
stop-animation
On attaining an animation-mapped state, this component triggers this event to stop a previous animation.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
animation |
String
|
Describes the animation to stop. |
Listeners of This Event:
stop-audio
On receiving this message, audio will stop playing.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
audioId |
String
|
If an audioId is provided, that particular sound instance is stopped. Otherwise all audio is stopped. |
Listeners of This Event:
stop-chasing
On receiving this message, the component will cease chasing the entity.
- Source:
Listeners of This Event:
stop-moving
Stops linear motion until movement messages are again received.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
state.pressed |
Boolean
|
<optional> |
If |
Listeners of This Event:
stop-racing
Causes the entity to stop racing.
- Source:
Listeners of This Event:
stop-timer
Stops the timer's countdown. If resetOnStop
is true
, resets timer.
- Source:
Listeners of This Event:
stop-turning
Stops rotational motion until movement messages are again received.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
state.pressed |
Boolean
|
<optional> |
If |
Listeners of This Event:
stop-tween
This event stops all running tweens on this component.
- Source:
Listeners of This Event:
stop-velocity
This event sets the velocity to inactive.
- Source:
Listeners of This Event:
stopped-racing
This event is triggered when the entity stops racing.
- Source:
stopped-winding
This event is triggered when the entity stops winding.
- Source:
tick
This event is triggered on the game as well as each layer currently loaded.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
tickMessage |
Object
|
Event tracking tick data. This object is re-used for subsequent ticks.
|
toggle-disabled
Toggles whether the entity is disabled.
- Source:
Listeners of This Event:
toggle-highlight
Toggles the entity's highlighted state.
- Source:
Listeners of This Event:
toggle-mute
On receiving this message, the audio will mute if unmuted, and unmute if muted.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
audioId |
String
|
If an audioId is provided, that particular sound instance is toggled. Otherwise all audio is toggled from mute to unmute or vice versa. |
Listeners of This Event:
transform
This message performs an immediate transform of the entity by performing the transformation via a prepended matrix multiplication.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
transform |
Array
|
String
|
A 3x3 @D Array or a string describing a transformation. |
Listeners of This Event:
turn-around
On receiving this message, the component will check the collision side and re-orient itself accordingly.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
collisionInfo |
platypus.CollisionData
|
Uses direction of collision to determine whether to turn around. |
Listeners of This Event:
turn-left
On receiving this event, the entity turns left.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
state.pressed |
boolean
|
<optional> |
If |
Listeners of This Event:
turn-right
On receiving this event, the entity turns right.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
state.pressed |
boolean
|
<optional> |
If |
Listeners of This Event:
tween
Trigger this event to play a tween using the same spec used for a tween on this component's events
property.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
tween |
Object
|
Array
|
Listeners of This Event:
tween-transform
This message performs a timed transform of the entity by performing the transformation via a prepended matrix multiplication.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
transform |
Array
|
String
|
A 3x3 @D Array or a string describing a transformation. |
Listeners of This Event:
unhighlight
Sets the entity's highlighted state to false
.
- Source:
Listeners of This Event:
unload-layer
This event is triggered on the layer to allow children of the layer to place a hold on the closing until they're ready.
Parameters:
Name | Type | Description |
---|---|---|
data |
Object
|
A list of key-value pairs of data sent into this Scene from the previous Scene. |
hold |
function
|
Calling this function places a hold; |
release |
function
|
Calling this function releases a previous hold. |
unmute-audio
On receiving this message all audio will unmute, or a particular sound instance will unmute if an id is specified.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
audioId |
String
|
If an audioId is provided, that particular sound instance will unmute. Otherwise all audio is unmuted. |
Listeners of This Event:
unpause-audio
On receiving this message all audio will unpause, or a particular sound instance will unpause if an id is specified.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
audioId |
String
|
If an audioId is provided, that particular sound instance will unpause. Otherwise all audio is unpaused. |
Listeners of This Event:
unpause-controls
This message will allow the controller to trigger messages until "pause-controls" is triggered on the entity.
- Source:
Listeners of This Event:
unpause-movment
Unpauses all movement on the Entity.
- Source:
Listeners of This Event:
unpause-tween
This event unpauses all running tweens on this component.
- Source:
Listeners of This Event:
update-animation
This event is triggered each tick to check for animation updates.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
playing |
Boolean
|
Whether the animation is in a playing or paused state. |
Listeners of This Event:
update-content
A call used to notify other components that the count or total has changed.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
update.text |
string
|
String describing the current count. |
west
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due west.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
west-northwest
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due west-northwest.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
west-southwest
If the soft joystick is enabled on this component, it will broadcast this directional message if the joystick is dragged due west-southwest.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
wind-up
Causes the entity to wind up for a race.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message.pressed |
Boolean
|
If |
Listeners of This Event:
winding
This event is triggered as the entity winds up.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
fraction |
Number
|
The amount of progress that has been made from 0 to 1. |
world-loaded
Once finished loading the map, this message is triggered on the entity to notify other components of completion.
- Source:
Parameters:
Name | Type | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
message |
platypus.Data
|
World data.
|
Listeners of This Event:
joystick:down
This event is triggered when there is an active touch in the joystick area.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
joystick:up
This event is triggered when there is an active touch is released from the joystick area.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original pointer event object is passed along with the control message. |
mouse:mouse-left:down
This component triggers the state of mouse inputs on the entity if a render component of the entity accepts mouse input.
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original mouse event object is passed along with the control message. |
mouse:mouse-left:up
This component triggers the state of mouse inputs on the entity if a render component of the entity accepts mouse input (for example [[Render-Animation]]).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original mouse event object is passed along with the control message. |
mouse:mouse-middle:down
This component triggers the state of mouse inputs on the entity if a render component of the entity accepts mouse input (for example [[Render-Animation]]).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original mouse event object is passed along with the control message. |
mouse:mouse-middle:up
This component triggers the state of mouse inputs on the entity if a render component of the entity accepts mouse input (for example [[Render-Animation]]).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original mouse event object is passed along with the control message. |
mouse:mouse-right:down
This component triggers the state of mouse inputs on the entity if a render component of the entity accepts mouse input (for example [[Render-Animation]]).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original mouse event object is passed along with the control message. |
mouse:mouse-right:up
This component triggers the state of mouse inputs on the entity if a render component of the entity accepts mouse input (for example [[Render-Animation]]).
- Source:
Parameters:
Name | Type | Description |
---|---|---|
message |
Event
|
The original mouse event object is passed along with the control message. |