Options
All
  • Public
  • Public/Protected
  • All
Menu

GDAPI

Index

Type aliases

GDCallback

GDCallback: "preEvents" | "postEvents" | "sceneLoaded" | "scenePaused" | "sceneResumed" | "sceneUnloading" | "sceneUnloaded" | "objectDeleted"

A list of registerable callbacks. Note that FIRST_SCENE_LOADED will never actually be called, as mods are always loaded after the first scene has finished loading.

RuntimeSceneCallback

RuntimeSceneCallback: (runtimeScene: gdjs.RuntimeScene, object: gdjs.RuntimeObject) => void

A GDevelop runtime event callback.

param

The scene affected by the callback event.

param

object (if an object is affected).

Type declaration

    • (runtimeScene: gdjs.RuntimeScene, object: gdjs.RuntimeObject): void
    • Parameters

      • runtimeScene: gdjs.RuntimeScene
      • object: gdjs.RuntimeObject

      Returns void

Variables

currentScene

currentScene: gdjs.RuntimeScene = ...

The instance of the current RuntimeScene. Can be null if used between the load of GDAPI and a game frame, since the game is hijacked at the scene update.

see

https://docs.gdevelop-app.com/GDJS%20Runtime%20Documentation/RuntimeScene.html

game

game: gdjs.RuntimeGame = ...

The instance of the current RuntimeGame. Can be null if used between the load of GDAPI and a game frame, since the game is hijacked at the scene update.

see

https://docs.gdevelop-app.com/GDJS%20Runtime%20Documentation/RuntimeGame.html

Functions

Const getGame

  • getGame(): Promise<RuntimeGame>

Const getScene

  • getScene(): Promise<RuntimeScene>

Const installPolyfills

  • installPolyfills(): void
  • Polyfills missing GDevelop API features for games made with older versions of GDevelop.

    Returns void

Const loadExtension

  • loadExtension(extension: "PlatformBehavior" | "DestroyOutsideBehavior" | "TiledSpriteObject" | "DraggableBehavior" | "TopDownMovementBehavior" | "TextObject" | "ParticleSystem" | "PanelSpriteObject" | "AnchorBehavior" | "PrimitiveDrawing" | "TextEntryObject" | "Inventory" | "LinkedObjects" | "SystemInfo" | "Shopify" | "PathfindingBehavior" | "PhysicsBehavior" | "AdMob" | "AdvancedWindow" | "BBText" | "DebuggerTools" | "DeviceSensors" | "DeviceVibration" | "DialogueTree" | "Effects" | "MyDummyExtension" | "FacebookInstantGames" | "FileSystem" | "Firebase" | "Lighting" | "P2P" | "Physics2" | "Screenshot" | "SpatialSound" | "TileMap" | "Tween" | "Video", version?: string): Promise<void>
  • Loads a GDevelop extension.

    Parameters

    • extension: "PlatformBehavior" | "DestroyOutsideBehavior" | "TiledSpriteObject" | "DraggableBehavior" | "TopDownMovementBehavior" | "TextObject" | "ParticleSystem" | "PanelSpriteObject" | "AnchorBehavior" | "PrimitiveDrawing" | "TextEntryObject" | "Inventory" | "LinkedObjects" | "SystemInfo" | "Shopify" | "PathfindingBehavior" | "PhysicsBehavior" | "AdMob" | "AdvancedWindow" | "BBText" | "DebuggerTools" | "DeviceSensors" | "DeviceVibration" | "DialogueTree" | "Effects" | "MyDummyExtension" | "FacebookInstantGames" | "FileSystem" | "Firebase" | "Lighting" | "P2P" | "Physics2" | "Screenshot" | "SpatialSound" | "TileMap" | "Tween" | "Video"

      The extension to load.

    • version: string = "beta105"

    Returns Promise<void>

Const registerCallback

Const unregisterCallback