Type Definitions


Properties to set up a behavior.

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.



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).

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.



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

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.<VariableData>

The list of default variables.

behaviors Array.<BehaviorData>

The list of default behaviors.



Data representation of a GDevelop variable

Name Type Attributes Description
name string

The name of the variable. Used if a child variable.

value string <optional>

The value of the variable, either string or number. Leave blank for structures.

children Array.<VariableData> <optional>

The children of the structure. Leave blank if value is defined.