Skip to content

Expressions reference

Expressions can be entered when you see a field with one of these buttons:

  • The left button indicates a "string expression" (a text)
  • The right button indicates a "numerical expression" (a number)

This page is a reference of all expressions that can be used in GDevelop, grouped by the extension, object or behavior they belong too. When Object is written, you should enter an object name. Learn more here about how to write expressions

Tip

Expressions are sometime also called functions, like in mathematics.

Objects

Common features that can be used for all objects in GDevelop. Read more explanations about it.

Expression Description
PickedInstancesCount() Return the number of instances picked by the previous conditions (or actions).
SceneInstancesCount() Return the number of instances of the specified objects living on the scene.
Expression Description
Object.Angle() Current angle, in degrees, of the object
Object.AngleToObject() Compute the angle between two objects (in degrees). If you need the angle to an arbitrary position, use AngleToPosition.
Object.AngleToPosition() Compute the angle between the object center and a "target" position (in degrees). If you need the angle between two objects, use AngleToObject.
Object.ArrayVariableFirstNumber() Get the value of the first element of an object array variable, if it is a number variable.
Object.ArrayVariableFirstString() Get the value of the first element of an object array variable, if it is a text (string) variable.
Object.ArrayVariableLastNumber() Get the value of the last element of an object array variable, if it is a number variable.
Object.ArrayVariableLastString() Get the value of the last element of an object array variable, if it is a text (string) variable.
Object.BoundingBoxBottom() Return the bounding box (the area encapsulating the object) bottom position.
Object.BoundingBoxCenterX() Return the bounding box (the area encapsulating the object) center X position.
Object.BoundingBoxCenterY() Return the bounding box (the area encapsulating the object) center Y position.
Object.BoundingBoxLeft() Return the bounding box (the area encapsulating the object) left position.
Object.BoundingBoxRight() Return the bounding box (the area encapsulating the object) right position.
Object.BoundingBoxTop() Return the bounding box (the area encapsulating the object) top position.
Object.CenterX() Return the X position of the center of rotation.
Object.CenterY() Return the Y position of the center of rotation.
Object.Distance() Distance between two objects
Object.DistanceToPosition() Distance between an object and a position
Object.ForceAngle() Angle of the sum of forces (in degrees)
Object.ForceLength() Length of the sum of forces
Object.ForceX() X coordinate of the sum of forces
Object.ForceY() Y coordinate of the sum of forces
Object.Height() Height of the object
Object.Layer() Return the name of the layer the object is on
Object.ObjectName() Return the name of the object
Object.ObjectTimerElapsedTime() Value of an object timer
Object.SqDistance() Square distance between two objects
Object.SqDistanceToPosition() Square distance between an object and a position
Object.Variable() Number value of an object variable
Object.VariableChildCount() Number of children in an object array or structure variable
Object.VariableString() Text of an object variable
Object.Width() Width of the object
Object.X() X position of the object
Object.XFromAngleAndDistance() Compute the X position when given an angle and distance relative to the starting object. This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.
Object.Y() Y position of the object
Object.YFromAngleAndDistance() Compute the Y position when given an angle and distance relative to the starting object. This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.
Object.ZOrder() Z-order of an object

Sprite

Animated object which can be used for most elements of a game. Read more explanations about it.

Expression Description
Object.AnimationFrameCount() Number of frames in the current animation of the object
Object.PointX() X position of a point
Object.PointY() Y position of a point
Object.Sprite() Current frame of the animation of the object

Conversion

Expressions to convert number, texts and quantities. Read more explanations about it.

Expression Description
LargeNumberToString() Convert the result of the expression to text, without using the scientific notation
ObjectVarToJSON() Convert an object variable to JSON
ToDeg() Converts the angle, expressed in radians, into degrees
ToJSON() Convert a variable to JSON
ToNumber() Convert the text to a number
ToRad() Converts the angle, expressed in degrees, into radians
ToString() Convert the result of the expression to text

Variables

Actions, conditions and expressions to handle variables, from simple variables like the player score, the number of remaining lives to complex variables containing arbitrary data like an inventory or the result of a web request. Read more explanations about it.

Expression Description
GlobalVariable() Number value of a global variable
GlobalVariableChildCount() Number of children in a global array or structure variable
GlobalVariableFirstNumber() Value of the first element of a global array variable, if it is a number variable
GlobalVariableFirstString() Value of the first element of a global array variable, if it is a text (string) variable.
GlobalVariableLastNumber() Value of the last element of a global array variable, if it is a number variable
GlobalVariableLastString() Value of the last element of a global array variable, if it is a text (string) variable.
GlobalVariableString() Text of a global variable
SceneVariableFirstNumber() Get the value of the first element of a scene array variable, if it is a number.
SceneVariableFirstString() Get the value of the first element of a scene array variable, if it is a text (string).
SceneVariableLastNumber() Get the value of the last element of a scene array variable, if it is a number.
SceneVariableLastString() Get the value of the last element of a scene array variable, if it is a text (string).
Variable() Number value of a scene variable
VariableChildCount() Number of children in a scene array or structure variable
VariableFirstNumber() Get the value of the first element of an array variable, if it is a number.
VariableFirstString() Get the value of the first element of an array variable, if it is a text (string).
VariableLastNumber() Get the value of the last element of an array variable, if it is a number.
VariableLastString() Get the value of the last element of an array variable, if it is a text (string).
VariableString() Text of a scene variable

Mouse and touch

Conditions and actions to handle either the mouse or touches on touchscreen. By default, conditions related to the mouse will also handle the touches - so that it's easier to handle both in your game. You can disable this behavior if you want to handle them separately in different events. Read more explanations about it.

Expression Description
CursorX() Return the X position of the cursor or of a touch.
CursorY() Return the Y position of the cursor or of a touch.
MouseWheelDelta() Mouse wheel displacement
StartedTouchOrMouseCount() The number of touches (including the mouse) that have just started on this frame. The touch identifiers can be accessed using StartedTouchOrMouseId().
StartedTouchOrMouseId() The identifier of the touch or mouse that has just started on this frame. The number of touches can be accessed using StartedTouchOrMouseCount().
TouchX() Return the X position of a specific touch.
TouchY() Return the Y position of a specific touch.

Keyboard

Allows your game to respond to keyboard input. Note that this does not work with on-screen keyboard on touch devices: use instead conditions related to touch when making a game for mobile/touchscreen devices. Read more explanations about it.

Expression Description
LastPressedKey() Get the name of the latest key pressed on the keyboard

Scene

Actions and conditions to manipulate the scenes during the game.

Expression Description
CurrentSceneName() Name of the current scene
SceneLoadingProgress() Return The progress of resources loading in background for a scene (between 0 and 1)..

Timers and time

Actions and conditions to run timers, get the current time or modify the time scale (speed at which the game is running - useful for slow motion effects). Read more explanations about it.

Expression Description
Time() Current time
TimeDelta() Time elapsed since the last frame rendered on screen
TimeFromStart() Time elapsed since the beginning of the scene
TimeScale() Returns the time scale of the scene.
TimerElapsedTime() Value of a scene timer

Mathematical tools

A set of mathematical functions that can be used in expressions.

Expression Description
AngleBetweenPositions() Compute the angle between two positions (in degrees).
AngleDifference() Difference between two angles
DistanceBetweenPositions() Compute the distance between two positions.
Pi() The number Pi (3.1415...)
Random() Random integer
RandomFloat() Random float
RandomFloatInRange() Random float in range
RandomInRange() Random integer in range
RandomWithStep() Random value in steps
XFromAngleAndDistance() Compute the X position when given an angle and distance relative to the origin (0;0). This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.
YFromAngleAndDistance() Compute the Y position when given an angle and distance relative to the origin (0;0). This is also known as getting the cartesian coordinates of a 2D vector, using its polar coordinates.
abs() Absolute value
acos() Arccosine, return an angle (in radian). ToDeg allows to convert it to degrees.
acosh() Hyperbolic arccosine
asin() Arcsine, return an angle (in radian). ToDeg allows to convert it to degrees.
asinh() Arcsine
atan() Arctangent, return an angle (in radian). ToDeg allows to convert it to degrees.
atan2() 2 argument arctangent (atan2)
atanh() Hyperbolic arctangent
cbrt() Cube root
ceil() Round number up to an integer
ceilTo() Round number up to the Nth decimal place
clamp() Restrict a value to a given range
cos() Cosine of an angle (in radian). If you want to use degrees, useToRad: sin(ToRad(45)).
cosh() Hyperbolic cosine
cot() Cotangent of a number
csc() Cosecant of a number
exp() Exponential of a number
floor() Round number down to an integer
floorTo() Round number down to the Nth decimal place
lerp() Linearly interpolate a to b by x
lerpAngle() Linearly interpolates between two angles (in degrees) by taking the shortest direction around the circle.
log() Logarithm
log10() Base-10 logarithm
log2() Base 2 Logarithm
max() Maximum of two numbers
min() Minimum of two numbers
mod() x mod y
normalize() Remap a value between 0 and 1.
nthroot() Nth root of a number
pow() Raise a number to power n
round() Round a number
roundTo() Round a number to the Nth decimal place
sec() Secant
sign() Return the sign of a number (1,-1 or 0)
sin() Sine of an angle (in radian). If you want to use degrees, useToRad: sin(ToRad(45)).
sinh() Hyperbolic sine
sqrt() Square root of a number
tan() Tangent of an angle (in radian). If you want to use degrees, useToRad: tan(ToRad(45)).
tanh() Hyperbolic tangent
trunc() Truncate a number

Layers and cameras

Each scene can be composed of multiple layers. These conditions and actions allow to manipulate them during the game. In particular, you can move the camera of a layer to center it on an object or a position. Read more explanations about it.

Expression Description
CameraAngle() Return the angle of rotation of a camera (in degrees).
CameraBorderBottom() Return the position of the bottom border of a camera.
CameraBorderLeft() Return the position of the left border of a camera.
CameraBorderRight() Return the position of the right border of a camera.
CameraBorderTop() Return the position of the top border of a camera.
CameraCenterX() Return the X position of the center of a camera.
CameraCenterY() Return the Y position of the center of a camera.
CameraHeight() Return the height of a camera of a layer.
CameraWidth() Return the width of a camera of a layer.
CameraZoom() Zoom of a camera of a layer
LayerDefaultZOrder() Default Z Order for a layer
LayerTimeScale() Returns the time scale of the specified layer.

Sounds and music

GDevelop provides several conditions and actions to play audio files. They can be either long music or short sound effects. Read more explanations about it.

Expression Description
GlobalVolume() Global volume value
MusicChannelPitch() Music's pitch
MusicChannelPlayingOffset() Music playing offset
MusicChannelVolume() Music volume
SoundChannelPitch() Sound's pitch
SoundChannelPlayingOffset() Sound playing offset
SoundChannelVolume() Sound volume

Game window and resolution

Provides actions and conditions to manipulate the game window. Depending on the platform on which the game is running, not all of these features can be applied. Read more explanations about it.

Expression Description
SceneWindowHeight() Height of the scene window (or scene canvas for HTML5 games)
SceneWindowWidth() Width of the scene window (or scene canvas for HTML5 games)
ScreenHeight() Height of the screen (or the page for HTML5 games in browser)
ScreenWidth() Width of the screen (or the page for HTML5 games in browser)
WindowTitle() Window's title

Text manipulation

Provides expressions to manipulate strings (also called texts).

Expression Description
FromCodePoint() Get character from code point
NewLine() Insert a new line
StrAt() Get a character from a text
StrFind() Search in a text (return the position of the result or -1 if not found)
StrFindFrom() Search in a text, starting from a position (return the position of the result or -1 if not found)
StrFindLast() Search the last occurrence in a string (return the position of the result, from the beginning of the string, or -1 if not found)
StrFindLastFrom() Search in a text the last occurrence, starting from a position (return the position of the result, from the beginning of the string, or -1 if not found)
StrLength() Length of a text
StrRepeat() Repeat a text
SubStr() Get a portion of a text
ToLowerCase() Lowercase a text
ToUpperCase() Uppercase a text

Animatable capability

Animate objects. Read more explanations about it.

Expression Description
Object.Animation::Duration() Return the current animation duration (in seconds).
Object.Animation::ElapsedTime() Return the elapsed time from the beginning of the animation (in seconds).
Object.Animation::Index() Return the animation played by the object using the animation number (from the animations list).
Object.Animation::Name() Return the animation played by the object using the name of the animation.
Object.Animation::SpeedScale() Return the animation speed scale (1 = the default speed, >1 = faster and <1 = slower).

Effect capability

Apply visual effects to objects. Read more explanations about it.

No expressions for this behavior.


Flippable capability

Flip objects. Read more explanations about it.

No expressions for this behavior.


Resizable capability

Change the object dimensions. Read more explanations about it.

No expressions for this behavior.


Scalable capability

Change the object scale. Read more explanations about it.

Expression Description
Object.Scale::Value() Return the scale of the object (default scale is 1).
Object.Scale::X() Return the scale on X axis of the object (default scale is 1).
Object.Scale::Y() Return the scale on Y axis of the object (default scale is 1).

Opacity capability

Change the object opacity. Read more explanations about it.

Expression Description
Object.Opacity::Value() Return the opacity of an object, between 0 (fully transparent) to 255 (opaque).

Text capability

Access objects text. Read more explanations about it.

Expression Description
Object.Text::Value() Return the text.

Platform (from extension Platform behavior)

Flag objects as being platforms which characters can run on. Read more explanations about it.

No expressions for this behavior.

Platformer character (from extension Platform behavior)

Jump and run on platforms. Read more explanations about it.

Expression Description
Object.PlatformerObject::Acceleration() Return the horizontal acceleration of the object (in pixels per second per second).
Object.PlatformerObject::CurrentFallSpeed() Return the current fall speed of the object (in pixels per second). Its value is always positive.
Object.PlatformerObject::CurrentJumpSpeed() Return the current jump speed of the object (in pixels per second). Its value is always positive.
Object.PlatformerObject::CurrentSpeed() Return the current horizontal speed of the object (in pixels per second). The object moves to the left with negative values and to the right with positive ones
Object.PlatformerObject::Deceleration() Return the horizontal deceleration of the object (in pixels per second per second).
Object.PlatformerObject::Gravity() Return the gravity applied on the object (in pixels per second per second).
Object.PlatformerObject::JumpSpeed() Return the jump speed of the object (in pixels per second). Its value is always positive.
Object.PlatformerObject::JumpSustainTime() Return the jump sustain time of the object (in seconds).This is the time during which keeping the jump button held allow the initial jump speed to be maintained.
Object.PlatformerObject::LadderClimbingSpeed() Return the ladder climbing speed of the object (in pixels per second).
Object.PlatformerObject::MaxFallingSpeed() Return the maximum falling speed of the object (in pixels per second).
Object.PlatformerObject::MaxSpeed() Return the maximum horizontal speed of the object (in pixels per second).

Destroy when outside of the screen (from extension Destroy Outside Screen Behavior)

Destroy objects automatically when they go outside of the screen's borders. Read more explanations about it.

No expressions for this behavior.


Tiled Sprite (from extension Tiled Sprite Object)

Displays an image repeated over an area. Read more explanations about it.

Expression Description
Object.XOffset() Return the offset used on the X axis when displaying the image.
Object.YOffset() Return the offset used on the Y axis when displaying the image.

Draggable object (from extension Draggable Behavior)

Move objects by holding a mouse button (or touch). Read more explanations about it.

No expressions for this behavior.


Top-down movement (4 or 8 directions) (from extension Top-down movement)

Move objects left, up, right, and down (and, optionally, diagonally). Read more explanations about it.

Expression Description
Object.TopDownMovement::Acceleration() Acceleration of the object
Object.TopDownMovement::Angle() Angle, in degrees, of the movement
Object.TopDownMovement::AngleOffset() Rotation offset applied to the object
Object.TopDownMovement::AngularMaxSpeed() Angular maximum speed of the object
Object.TopDownMovement::Deceleration() Deceleration of the object
Object.TopDownMovement::MaxSpeed() Maximum speed of the object
Object.TopDownMovement::MovementAngleOffset() Return the movement angle offset.
Object.TopDownMovement::Speed() Speed of the object
Object.TopDownMovement::StickAngle() Return the angle of the simulated stick input (in degrees)
Object.TopDownMovement::XVelocity() Speed on the X axis of the movement
Object.TopDownMovement::YVelocity() Speed on the Y axis of the movement

Text (from extension Text object)

Displays a text on the screen. Read more explanations about it.

Expression Description
Object.FontSize() Return the font size of a text object.
Object.OutlineThickness() Return the outline thickness of the text.
Object.Padding() Padding
Object.ShadowAngle() Return the shadow angle of the text.
Object.ShadowBlurRadius() Return the shadow blur radius of the text.
Object.ShadowDistance() Return the shadow distance of the text.
Object.ShadowOpacity() Return the shadow opacity of the text.

Particles emitter (from extension Particle system)

Displays a large number of small particles to create visual effects. Read more explanations about it.

Expression Description
Object.ConeSprayAngle() Angle of the spray cone
Object.CurrentParticleCount() Number of particles currently displayed.
Object.EmitterAngle() Emission angle of the particles.
Object.EmitterForceMax() The maximal emission force of the particles.
Object.EmitterForceMin() The minimal emission force of the particles.
Object.Flow() Flow of the particles (particles/second).
Object.MaxParticlesCount() Return the maximum number of displayed particles.
Object.ParticleAlpha1() Start opacity of the particles.
Object.ParticleAlpha2() End opacity of the particles.
Object.ParticleBlue1() The start color blue component of the particles.
Object.ParticleBlue2() The end color blue component of the particles.
Object.ParticleGravityAngle() Angle of gravity.
Object.ParticleGravityLength() Value of gravity.
Object.ParticleGravityX() Gravity of particles applied on X-axis.
Object.ParticleGravityY() Gravity of particles applied on Y-axis.
Object.ParticleGreen1() The start color green component of the particles.
Object.ParticleGreen2() The end color green component of the particles.
Object.ParticleLifeTimeMax() Maximum lifetime of the particles.
Object.ParticleLifeTimeMin() Minimum lifetime of the particles.
Object.ParticleRed1() The start color red component of the particles.
Object.ParticleRed2() The end color red component of the particles.
Object.ParticleRotationMaxSpeed() Return the maximum rotation speed of the particles.
Object.ParticleRotationMinSpeed() Return the minimum rotation speed of the particles.
Object.ParticleSize1() Start size of particles.
Object.ParticleSize2() End size of particles.
Object.RendererParam1() Rendering first parameter
Object.RendererParam2() Rendering second parameter
Object.Tank() Capacity of the particle tank.
Object.Texture() Name of the image displayed by particles.
Object.ZoneRadius() The radius of the emission zone.

Panel Sprite ("9-patch") (from extension Panel Sprite (9-patch) Object)

An image with edges and corners that are stretched separately from the full image. Read more explanations about it.

No expressions for this object.


Anchor

Anchor objects to the window's bounds. Read more explanations about it.

No expressions for this behavior.


Shape painter

Allows you to draw simple shapes on the screen using the events. Read more explanations about it.

Expression Description
Object.Antialiasing() Returns the type of anti-aliasing in use: none, low, medium, or high.
Object.FillColorBlue() Filing color blue component
Object.FillColorGreen() Filing color green component
Object.FillColorRed() Filing color red component
Object.FillOpacity() Filling opacity
Object.OutlineColorBlue() Outline color blue component
Object.OutlineColorGreen() Outline color green component
Object.OutlineColorRed() Outline color red component
Object.OutlineOpacity() Outline opacity
Object.OutlineSize() Outline size
Object.ToDrawingX() X drawing coordinate of a point from the scene
Object.ToDrawingY() Y drawing coordinate of a point from the scene
Object.ToSceneX() X scene coordinate of a point from the drawing
Object.ToSceneY() Y scene coordinate of a point from the drawing

Text entry (from extension Text entry object)

Invisible object used to get the text entered with the keyboard. Read more explanations about it.

Expression Description
Object.String() Text entered with keyboard

Inventories

Provides actions and conditions to add an inventory to your game, with items in memory. Read more explanations about it.

Expression Description
Inventory::Count() Get the number of an item in the inventory
Inventory::Maximum() Get the maximum of an item in the inventory, or 0 if it is unlimited

Pathfinding (from extension Pathfinding behavior)

Move objects to a target while avoiding all objects that are flagged as obstacles. Read more explanations about it.

Expression Description
Object.Pathfinding::Acceleration() Acceleration of the object on the path
Object.Pathfinding::AngleOffset() Rotation offset applied the object on the path
Object.Pathfinding::AngularMaxSpeed() Angular maximum speed of the object on the path
Object.Pathfinding::CellHeight() Height of the virtual grid
Object.Pathfinding::CellWidth() Width of the virtual grid
Object.Pathfinding::DestinationX() Destination X position
Object.Pathfinding::DestinationY() Destination Y position
Object.Pathfinding::ExtraBorder() Extra border applied the object on the path
Object.Pathfinding::GetNodeX() Get next waypoint X position
Object.Pathfinding::GetNodeY() Get next waypoint Y position
Object.Pathfinding::GridOffsetX() Return X offset of the virtual grid.
Object.Pathfinding::GridOffsetY() Return Y offset of the virtual grid.
Object.Pathfinding::LastNodeX() Last waypoint X position
Object.Pathfinding::LastNodeY() Last waypoint Y position
Object.Pathfinding::MaxSpeed() Maximum speed of the object on the path
Object.Pathfinding::MovementAngle() Angle of movement on its path
Object.Pathfinding::NextNodeIndex() Get the index of the next waypoint to reach
Object.Pathfinding::NextNodeX() Get next waypoint X position
Object.Pathfinding::NextNodeY() Get next waypoint Y position
Object.Pathfinding::NodeCount() Get the number of waypoints on the path
Object.Pathfinding::Speed() Speed of the object on the path

Obstacle for pathfinding (from extension Pathfinding behavior)

Flag objects as being obstacles for pathfinding. Read more explanations about it.

Expression Description
Object.PathfindingObstacle::Cost() Obstacle cost

Physics Engine (from extension Physics Engine (deprecated))

Make objects move as if they are subject to the laws of physics. If you're creating a new game, prefer Physics Engine 2.0 Read more explanations about it.

Expression Description
Object.Physics::AngularDamping() Angular damping
Object.Physics::AngularVelocity() Angular speed
Object.Physics::LinearDamping() Linear damping
Object.Physics::LinearVelocity() Linear speed
Object.Physics::LinearVelocityX() X component
Object.Physics::LinearVelocityY() Y component
Object.Physics::PolygonScaleX() Collision polygon X scale
Object.Physics::PolygonScaleY() Collision polygon Y scale

3D

Support for 3D in GDevelop.

Expression Description
Scene3D::CameraFarPlane() Return the camera far plane distance.
Scene3D::CameraFov() Return the camera field of view.
Scene3D::CameraNearPlane() Return the camera near plane distance.
Scene3D::CameraRotationX() Return the camera rotation on X axis.
Scene3D::CameraRotationY() Return the camera rotation on Y axis.
Scene3D::CameraZ() Return the camera position on Z axis.

3D Box (from extension 3D)

A box with images for each face

No expressions for this object.

3D Model (from extension 3D)

An animated 3D model.

No expressions for this object.

3D capability (from extension 3D)

Move the object in 3D space.

Expression Description
Object.Object3D::CenterZ() Return the Z position of the center of rotation.
Object.Object3D::Depth() Return the depth (size on Z axis).
Object.Object3D::RotationX() Return the rotation on X axis.
Object.Object3D::RotationY() Return the rotation on Y axis.
Object.Object3D::ScaleZ() Return the scale on Z axis of an object (default scale is 1).
Object.Object3D::Z() Return the Z position (the "elevation").

Advanced window management

Provides advanced features related to the game window positioning and interaction with the operating system.

Expression Description
AdvancedWindow::WindowOpacity() Returns the current window opacity (a number from 0 to 1, 1 being fully opaque).
AdvancedWindow::WindowX() Returns the current window X position.
AdvancedWindow::WindowY() Returns the current window Y position.

BBText (from extension BBCode Text Object)

Displays a rich text label using BBCode markup (allowing to set parts of the text as bold, italic, use different colors and shadows). Read more explanations about it.

Expression Description
Object.GetAlignment() Get the text alignment
Object.GetBBText() Get BBCode text
Object.GetFontFamily() Get the base font family
Object.GetFontSize() Get the base font size
Object.GetWrappingWidth() Get the wrapping width

Bitmap Text

Displays a text using a "Bitmap Font" (an image representing characters). This is more performant than a traditional Text object and it allows for complete control on the characters aesthetic. Read more explanations about it.

Expression Description
Object.Alignment() Return the text alignment.
Object.FontName() Return the font name (defined in the Bitmap font).
Object.FontSize() Return the font size, defined in the Bitmap Font.
Object.Text() Return the text.
Object.WrappingWidth() Return the width, in pixels, after which the text is wrapped on next line.

Device sensors

Allow the game to access the sensors of a mobile device. Read more explanations about it.

Expression Description
DeviceSensors::AccelerationX() Get the devices acceleration on the X-axis (m/s²)
DeviceSensors::AccelerationY() Get the devices acceleration on the Y-axis (m/s²)
DeviceSensors::AccelerationZ() Get the devices acceleration on the Z-axis (m/s²)
DeviceSensors::OrientationAbsolute() Get if the devices orientation is absolute and not relative
DeviceSensors::OrientationAlpha() Get the devices orientation Alpha (compass)
DeviceSensors::OrientationBeta() Get the devices orientation Beta
DeviceSensors::OrientationGamma() Get the devices orientation Gamma value
DeviceSensors::RotationAlpha() Get the devices rotation Alpha
DeviceSensors::RotationBeta() Get the devices rotation Beta
DeviceSensors::RotationGamma() Get the devices rotation Gamma

Dialogue Tree

Handle dialogue trees, made using Yarn Spinner. Useful to make complex dialogues with multiple choices. The Yarn Spinner editor is embedded in GDevelop so you can edit your dialogues without leaving GDevelop. Read more explanations about it.

Expression Description
DialogueTree::BranchTag() Get a tag of the current branch of the running dialogue via its index
DialogueTree::BranchTags() Get the tags of the current branch of the running dialogue
DialogueTree::BranchText() Get the full raw text of the current branch
DialogueTree::BranchTitle() Get the title of the current branch of the running dialogue
DialogueTree::ClippedLineText() Get dialogue line text clipped by the typewriter effect. Use the "Scroll clipped text" action to control the typewriter effect.
DialogueTree::CommandParameter() Get the parameters of a command call - <>
DialogueTree::CommandParametersCount() Get the number of parameters in the currently passed command
DialogueTree::HorizontalOptionsList() Get the text of all available options from an Options line type as a horizontal list. You can also pass the selected option's cursor string, which by default is ->
DialogueTree::LineText() Returns the current dialogue line text
DialogueTree::Option() Get the text of an option from an Options line type, using the option's Number. The numbers start from 0.
DialogueTree::OptionsCount() Get the number of options in an options line type
DialogueTree::SelectedOptionIndex() Get the number of the currently selected option. Use this to help you render the option selection marker at the right place.
DialogueTree::TagParameter() Get parameter from a Tag found by the branch contains tag condition
DialogueTree::Variable() Get dialogue state value
DialogueTree::VerticalOptionsList() Get the text of all available options from an Options line type as a vertical list. You can also pass the selected option's cursor string, which by default is ->
DialogueTree::VisitedBranchTitles() Get a list of all visited branches

Facebook Instant Games

Allow your game to send scores and interact with the Facebook Instant Games platform. Read more explanations about it.

Expression Description
FacebookInstantGames::PlayerId() Get the player unique identifier
FacebookInstantGames::PlayerName() Get the player name

File system

Access the filesystem of the operating system. Read more explanations about it.

Expression Description
FileSystem::DesktopPath() Get the path to the desktop folder.
FileSystem::DirectoryName() Returns the portion of the path that represents the directories, without the ending file name.
FileSystem::DocumentsPath() Get the path to the documents folder.
FileSystem::ExecutableFolderPath() Get the path to this game executable folder.
FileSystem::ExecutablePath() Get the path to this game executable file.
FileSystem::ExtensionName() Returns the extension of the file designated by the given path, including the extension period. For example: ".txt".
FileSystem::FileName() Returns the name of the file with its extension, if any.
FileSystem::PathDelimiter() Get the operating system path delimiter.
FileSystem::PicturesPath() Get the path to the pictures folder.
FileSystem::TempPath() Get the path to temp folder.
FileSystem::UserHomePath() Get the path to the user home folder.
FileSystem::UserdataPath() Get the path to userdata folder (for application settings).

Firebase

Use Google Firebase services (database, functions, storage...) in your game. Read more explanations about it.

Expression Description
Firebase::GetAccountCreationTime() Return the accounts creation time.
Firebase::GetAuthToken() Get the user authentication token. The token is the proof of authentication.
Firebase::GetLastLoginTime() Return the user last login time.
Firebase::GetPhoneNumber() Return the user phone number.
Firebase::GetPhotoURL() Gets an URL to the user profile picture.
Firebase::GetRefreshToken() Return the user refresh token. For advanced usage only.
Firebase::GetRemoteConfigNumber() Get a setting from Firebase Remote Config as Number.
Firebase::GetRemoteConfigString() Get a setting from Firebase Remote Config as a string.
Firebase::GetTenantID() Return the user tenant ID. For advanced usage only.
Firebase::GetUserDisplayName() Return the user display name.
Firebase::GetUserEmail() Return the user email address.
Firebase::GetUserUID() Return the user Unique IDentifier. Use that to link data to an user instead of the name or email.
Firebase::ServerTimestamp() Set a field to the timestamp on the server when the request arrives there

Leaderboards

Allow your game to send scores to your leaderboards. Read more explanations about it.

Expression Description
Leaderboards::FormatPlayerName() Formats a name so that it can be submitted to a leaderboard.
Leaderboards::LastSaveError() Get the error of the last save attempt.

Light (from extension Lights)

Displays a light on the scene, with a customizable radius and color. Add then the Light Obstacle behavior to the objects that must act as obstacle to the lights.

No expressions for this object.

Light Obstacle Behavior (from extension Lights)

Flag objects as being obstacles to light. The light emitted by light objects will be stopped by the object.

No expressions for this behavior.


Multiplayer

Allow players to connect to lobbies and play together. Read more explanations about it.

Expression Description
Multiplayer::CurrentPlayerNumber() Return the current player number in the lobby (1, 2, ...).
Multiplayer::CurrentPlayerPing() Get the ping of the current player in the lobby.
Multiplayer::CurrentPlayerUsername() Get the username of the current player in the lobby.
Multiplayer::LastJoinedPlayerNumber() Returns the player number of the player that has just joined the lobby.
Multiplayer::LastLeftPlayerNumber() Returns the player number of the player that has just left the lobby.
Multiplayer::MessageData() Returns the data received when the specified message was received from another player.
Multiplayer::MessageSender() Returns the player number of the sender of the specified message.
Multiplayer::ObjectsSynchronizationRate() Return objects synchronization rate (between 1 and 60, default is 30 times per second).
Multiplayer::PlayerPing() Get the ping of the player in the lobby.
Multiplayer::PlayerUsername() Get the username of the player in the lobby.
Multiplayer::PlayerVariableOwnership() Return the player owning the variable.
Multiplayer::PlayersInLobbyCount() Return the number of players in the lobby.

Multiplayer object (from extension Multiplayer)

Allow the object to be synchronized with other players in the lobby. Read more explanations about it.

Expression Description
Object.MultiplayerObject::PlayerObjectOwnership() Return the player owning the object.

P2P

Allow game instances to communicate remotely using messages sent via WebRTC (P2P). Read more explanations about it.

Expression Description
P2P::GetEventData() Returns the data received when the specified event was last triggered
P2P::GetEventSender() Returns the id of the peer that triggered the event
P2P::GetID() Gets the client ID of the current game instance
P2P::GetLastConnectedPeer() Gets the ID of the newly connected peer.
P2P::GetLastDisconnectedPeer() Gets the ID of the latest peer that has disconnected.
P2P::GetLastError() Gets the description of the last P2P error

Physics Engine 2.0

Simulate realistic object physics with gravity, forces, joints, etc. Read more explanations about it.

Expression Description
Object.Physics2::AngularDamping() Get the angular damping of an object.
Object.Physics2::AngularVelocity() Get the angular velocity of an object.
Object.Physics2::Density() Get the density of an object.
Object.Physics2::DistanceJointDampingRatio() Distance joint damping ratio
Object.Physics2::DistanceJointFrequency() Distance joint frequency
Object.Physics2::DistanceJointLength() Distance joint length
Object.Physics2::Friction() Get the friction of an object.
Object.Physics2::FrictionJointMaxForce() Friction joint maximum force
Object.Physics2::FrictionJointMaxTorque() Friction joint maximum torque
Object.Physics2::GearJointFirstJoint() Gear joint first joint
Object.Physics2::GearJointRatio() Gear joint ratio
Object.Physics2::GearJointSecondJoint() Gear joint second joint
Object.Physics2::GravityScale() Get the gravity scale of an object.
Object.Physics2::GravityX() World gravity on X axis
Object.Physics2::GravityY() World gravity on Y axis
Object.Physics2::Inertia() Return the rotational inertia of the object (in kilograms · meters²)
Object.Physics2::JointFirstAnchorX() Joint first anchor X
Object.Physics2::JointFirstAnchorY() Joint first anchor Y
Object.Physics2::JointReactionForce() Joint reaction force
Object.Physics2::JointReactionTorque() Joint reaction torque
Object.Physics2::JointSecondAnchorX() Joint second anchor X
Object.Physics2::JointSecondAnchorY() Joint second anchor Y
Object.Physics2::LinearDamping() Get the linear damping of an object.
Object.Physics2::LinearVelocity() Get the linear velocity of an object.
Object.Physics2::LinearVelocityAngle() Get the linear velocity angle of an object.
Object.Physics2::LinearVelocityX() Get the linear velocity of an object on X axis.
Object.Physics2::LinearVelocityY() Get the linear velocity of an object on Y axis.
Object.Physics2::Mass() Return the mass of the object (in kilograms)
Object.Physics2::MassCenterX() Mass center X
Object.Physics2::MassCenterY() Mass center Y
Object.Physics2::MotorJointAngularOffset() Motor joint angular offset
Object.Physics2::MotorJointCorrectionFactor() Motor joint correction factor
Object.Physics2::MotorJointMaxForce() Motor joint maximum force
Object.Physics2::MotorJointMaxTorque() Motor joint maximum torque
Object.Physics2::MotorJointOffsetX() Motor joint offset X
Object.Physics2::MotorJointOffsetY() Motor joint offset Y
Object.Physics2::MouseJointDampingRatio() Mouse joint damping ratio
Object.Physics2::MouseJointFrequency() Mouse joint frequency
Object.Physics2::MouseJointMaxForce() Mouse joint maximum force
Object.Physics2::MouseJointTargetX() Mouse joint target X
Object.Physics2::MouseJointTargetY() Mouse joint target Y
Object.Physics2::PrismaticJointAxisAngle() Prismatic joint axis angle
Object.Physics2::PrismaticJointMaxMotorForce() Prismatic joint maximum motor force
Object.Physics2::PrismaticJointMaxTranslation() Prismatic joint maximum translation
Object.Physics2::PrismaticJointMinTranslation() Prismatic joint minimum translation
Object.Physics2::PrismaticJointMotorForce() Prismatic joint motor force
Object.Physics2::PrismaticJointMotorSpeed() Prismatic joint motor speed
Object.Physics2::PrismaticJointReferenceAngle() Prismatic joint reference angle
Object.Physics2::PrismaticJointSpeed() Prismatic joint speed
Object.Physics2::PrismaticJointTranslation() Prismatic joint current translation
Object.Physics2::PulleyJointFirstGroundAnchorX() Pulley joint first ground anchor X
Object.Physics2::PulleyJointFirstGroundAnchorY() Pulley joint first ground anchor Y
Object.Physics2::PulleyJointFirstLength() Pulley joint first length
Object.Physics2::PulleyJointRatio() Pulley joint ratio
Object.Physics2::PulleyJointSecondGroundAnchorX() Pulley joint second ground anchor X
Object.Physics2::PulleyJointSecondGroundAnchorY() Pulley joint second ground anchor Y
Object.Physics2::PulleyJointSecondLength() Pulley joint second length
Object.Physics2::Restitution() Get the restitution of an object.
Object.Physics2::RevoluteJointAngle() Revolute joint current angle
Object.Physics2::RevoluteJointMaxAngle() Revolute joint maximum angle
Object.Physics2::RevoluteJointMaxMotorTorque() Revolute joint maximum motor torque
Object.Physics2::RevoluteJointMinAngle() Revolute joint minimum angle
Object.Physics2::RevoluteJointMotorSpeed() Revolute joint motor speed
Object.Physics2::RevoluteJointMotorTorque() Revolute joint motor torque
Object.Physics2::RevoluteJointReferenceAngle() Revolute joint reference angle
Object.Physics2::RevoluteJointSpeed() Revolute joint angular speed
Object.Physics2::RopeJointMaxLength() Rope joint maximum length
Object.Physics2::TimeScale() World time scale
Object.Physics2::WeldJointDampingRatio() Weld joint damping ratio
Object.Physics2::WeldJointFrequency() Weld joint frequency
Object.Physics2::WeldJointReferenceAngle() Weld joint reference angle
Object.Physics2::WheelJointAxisAngle() Wheel joint axis angle
Object.Physics2::WheelJointDampingRatio() Wheel joint damping ratio
Object.Physics2::WheelJointFrequency() Wheel joint frequency
Object.Physics2::WheelJointMaxMotorTorque() Wheel joint maximum motor torque
Object.Physics2::WheelJointMotorSpeed() Wheel joint motor speed
Object.Physics2::WheelJointMotorTorque() Wheel joint motor torque
Object.Physics2::WheelJointSpeed() Wheel joint speed
Object.Physics2::WheelJointTranslation() Wheel joint current translation
Object.Physics2::WorldScale() Return the world scale.

Player Authentication

Allow your game to authenticate players. Read more explanations about it.

Expression Description
PlayerAuthentication::UserID() Get the unique user ID of the authenticated player.
PlayerAuthentication::Username() Get the username of the authenticated player.

Spine (experimental)

Display and smoothly animate a 2D object with skeletal animations made with Spine. Use files exported from Spine (json, atlas and image). Read more explanations about it.

Expression Description
Object.Animation() Return the duration of the smooth transition between 2 animations (in second).
Object.PointAttachmentX() Return x position of spine point attachment.
Object.PointAttachmentY() Return y position of spine point attachment.

Steamworks (Steam) (experimental)

Adds integrations for Steam's Steamworks game development SDK.

Expression Description
Steamworks::ActionVectorX() The action vector of a Steam Input analog joystick on the X-axis, from 1 (all right) to -1 (all left).
Steamworks::ActionVectorY() The action vector of a Steam Input analog joystick on the Y-axis, from 1 (all up) to -1 (all down).
Steamworks::AppBuildID() Gets the ID of the current app build.
Steamworks::AppID() Obtains the game's Steam app ID, as declared in the games properties.
Steamworks::BetaName() Gets the name of the beta the player enrolled to in the Steam game properties.
Steamworks::ControllerCount() The amount of connected Steam Input controllers.
Steamworks::CountryCode() The player's country represented as its two-letter code.
Steamworks::CurrentLobbyAttribute() Obtains the value of one of the current lobby's attributes.
Steamworks::CurrentLobbyID() The ID of the current lobby, useful for letting other players join it.
Steamworks::CurrentLobbyMemberCount() Obtains the current lobby's member count.
Steamworks::CurrentLobbyMemberLimit() Obtains the current lobby's maximum member limit.
Steamworks::CurrentLobbyOwner() Obtains the Steam ID of the user that owns the current lobby.
Steamworks::GameLanguage() Gets the language the user set in the Steam game properties.
Steamworks::InstalledApplicationPath() Gets the path to an installed Steam application.
Steamworks::Level() Obtains the player's Steam level
Steamworks::LobbyAttribute() Obtains the value of one of a lobby's attributes.
Steamworks::LobbyMemberCount() Obtains a lobby's member count.
Steamworks::LobbyMemberLimit() Obtains a lobby's maximum member limit.
Steamworks::LobbyOwner() Obtains the Steam ID of the user that owns a lobby.
Steamworks::Name() The player's registered name on Steam.
Steamworks::ReadCloudFile() Reads a file from Steam Cloud and returns its contents.
Steamworks::ServerTime() Obtains the real current time from the Steam servers, which cannot be faked by changing the system time.
Steamworks::SteamID() The player's unique Steam ID number. Note that it is too big a number to load correctly as a traditional number ("floating point number"), and must be used as a string.
Steamworks::WorkshopItemDownloadProgress() The amount of data that has been downloaded by Steam for a currrently downloading item so far.
Steamworks::WorkshopItemDownloadTotal() The amount of data that needs to be downloaded in total by Steam for a currrently downloading item.
Steamworks::WorkshopItemInstallationTimestamp() The timestamp of the last time the contents file of an installed workshop item was updated.
Steamworks::WorkshopItemLocation() The file path to the contents file of an installed workshop item.
Steamworks::WorkshopItemSize() The size on disk taken by the contents file of an installed workshop item.

Text input (from extension Text Input)

A text field the player can type text into.

Expression Description
Object.BorderOpacity() Return the border opacity, between 0 (fully transparent) and 255 (opaque).
Object.BorderWidth() Return the border width.
Object.FillOpacity() Return the fill opacity, between 0 (fully transparent) and 255 (opaque).
Object.Font size() Return the font size.
Object.FontResourceName() Return the font name.
Object.InputType() Return the input type.
Object.Placeholder() Return the placeholder.

External Tilemap (Tiled/LDtk) collision mask (from extension Tile map)

Invisible object handling collisions with parts of a tilemap. Read more explanations about it.

No expressions for this object.

Tile map

Displays a tiled-based map. Read more explanations about it.

Expression Description
Object.GridColumnCount() Return the grid column count in the tile map.
Object.GridRowCount() Return the grid row count in the tile map.
Object.GridX() Get the grid column coordinates in the tile map corresponding to the scene coordinates.
Object.GridY() Get the grid row coordinates in the tile map corresponding to the scene coordinates.
Object.TileCenterX() Get the scene X position of the center of the tile.
Object.TileCenterY() Get the scene Y position of the center of the tile.
Object.TileIdAtGrid() Return the id of the tile at the grid coordinates.
Object.TileIdAtPosition() Return the id of the tile at the scene coordinates.
Object.TilesetColumnCount() Get the number of columns in the tileset.
Object.TilesetRowCount() Get the number of rows in the tileset.

External Tilemap (Tiled/LDtk) (from extension Tile map)

Displays a tiled-based map, made with the Tiled editor (https://www.mapeditor.org/) or the LDtk editor (https://ldtk.io/). Read more explanations about it.

Expression Description
Object.AnimationFps() Get the animation speed (in frames per second)
Object.AnimationSpeedScale() Get the Animation speed scale
Object.LayerIndex() Get the layer index being displayed
Object.LevelIndex() Return the level index being displayed..

Tweening

Animate object properties over time. This allows smooth transitions, animations or movement of objects to specified positions. Read more explanations about it.

Expression Description
Tween::Ease() Tween between 2 values according to an easing function.
Tween::Progress() Return the progress of a tween (between 0.0 and 1.0).
Tween::Value() Return the value of a tween. It is always 0 for tweens with several values.

Tween (from extension Tweening)

Smoothly animate position, angle, scale and other properties of objects. Read more explanations about it.

Expression Description
Object.Tween::Progress() Return the progress of a tween (between 0.0 and 1.0).
Object.Tween::Value() Return the value of a tween. It is always 0 for tweens with several values.

Video

Displays a video. Read more explanations about it.

Expression Description
Object.CurrentTime() Return the current time of a video object (in seconds).
Object.Duration() Return the duration of a video object (in seconds).
Object.PlaybackSpeed() Return the playback speed of a video object
Object.Volume() Get the volume of a video object, between 0 (muted) and 100 (maximum).