Global

Type Definitions

BehaviorData

Properties to set up a behavior.

Properties:
Name Type Description
name string

The name of the behavior (for getting from an object (object.getBehavior) for example)

type string

The behavior type. Used by GDJS to find the proper behavior to construct.

Source:

EventsFunctionContext

Represents the context of the events function (or the behavior method), if any. If the JavaScript code is running in a scene, this will be undefined (so you can't use this in a scene).

Properties:
Name Type Description
getObjects function

Get the list of instances of the specified object.

getObjectsLists function

Get the Hashtable containing the lists of instances of the specified object., You can alter the list and this will alter the objects picked for the next conditions/actions/events., If you don't need this, prefer using getObjects.

getBehaviorName function

Get the "real" behavior name, that can be used with getBehavior. For example: object.getBehavior(eventsFunctionContext.getBehaviorName("MyBehavior"))

createObject function

Create a new object from its name. The object is added to the instances living on the scene.

getArgument function

Get the value (string or number) of an argument that was passed to the events function. To get objects, use getObjects.

returnValue boolean | number | string

The return value that should be returned by the expression or the condition.

getLayer function

Do not use this. Use runtimeScene.getLayer instead.

Source:

ObjectData

Object containing initial properties for all objects extending gdjs.RuntimeObject.

Properties:
Name Type Description
name string

The name of the object. During the game, objects can be queried by their name (see gdjs.RuntimeScene.prototype.getObjects for example).

type string

The object type.

variables Array.<RootVariableData>

The list of default variables.

behaviors Array.<BehaviorData>

The list of default behaviors.

effects Array.<EffectData>

The list of effects.

Source:

RootVariableData

A variable child of a container. Those always have a name.

Properties:
Name Type Description
name string
Source: