### getAppInstallDirectory Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.steamworks.getAppInstallDirectory Retrieves the installation directory for a given application ID. ```APIDOC ## GET /getAppInstallDirectory ### Description Retrieves the installation directory for a given application ID. ### Method GET ### Endpoint /getAppInstallDirectory ### Parameters #### Query Parameters - **appId** (string) - Required - The ID of the application. ### Request Example ```json { "appId": "your_app_id" } ``` ### Response #### Success Response (200) - **installationDirectory** (string) - The path to the application's installation directory. #### Response Example ```json { "installationDirectory": "/path/to/your/app" } ``` ``` -------------------------------- ### isAppInstalled Function Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.steamworks.isAppInstalled Checks if a specific application is installed on the user's system. ```APIDOC ## isAppInstalled ### Description Checks if a specific application is installed on the user's system. ### Method N/A (This is a function call within the JavaScript engine) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```javascript if (gdjs.isAppInstalled("steam")) { console.log("Steam is installed."); } ``` ### Response #### Success Response (boolean) - **Returns**: A boolean value indicating whether the application is installed (`true`) or not (`false`). #### Response Example ```json true ``` #### Error Response N/A ``` -------------------------------- ### getName Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Gets the name of the current scene. ```APIDOC ## GET /name ### Description Get the name of the scene. ### Method GET ### Endpoint /name ### Parameters None ### Response #### Success Response (200) - **sceneName** (string) - The name of the scene. #### Response Example ```json { "sceneName": "Level1" } ``` ``` -------------------------------- ### startProfiler Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Starts a profiler to measure time spent in different sections of the engine within a scene. ```APIDOC ## startProfiler ### Description Start a new profiler to measures the time passed in sections of the engine in the scene. ### Method Not specified (likely a method of a class) ### Endpoint Not specified ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Parameters * **onProfilerStopped** ((oldProfiler) => void) - Required - Function to be called when the profiler is stopped. Will be passed the profiler as argument. * **oldProfiler** (Profiler) - void - Description of the old profiler object. ### Request Example ```json { "onProfilerStopped": "() => { console.log('Profiler stopped'); }" } ``` ### Response #### Success Response (200) void #### Response Example ```json null ``` ``` -------------------------------- ### Renderer Initialization API Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeGamePixiRenderer Functions for setting up the game's rendering system. ```APIDOC ## POST /initializeRenderers ### Description Sets up the rendering of the game for the given canvas. In most cases, `createStandardCanvas` can be used as an alternative for initialization. ### Method POST ### Endpoint /initializeRenderers ### Parameters #### Request Body - **gameCanvas** (HTMLCanvasElement) - The canvas element for which to initialize the renderers. ### Request Example ```javascript const canvas = document.getElementById('gameCanvas'); // Assuming a POST request is made to /initializeRenderers with the canvas element ``` ### Response #### Success Response (200) - **return_value** (void) - Indicates the operation completed successfully. #### Response Example ```json { "return_value": null } ``` ``` -------------------------------- ### Get Time from Start in Seconds (JavaScript) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.evtTools.runtimeScene.getTimeFromStartInSeconds Retrieves the time elapsed since the game started in seconds. This function is part of the GDevelop JavaScript game engine utilities and requires a `runtimeScene` object as input. It returns a numerical value representing the time in seconds. ```javascript /** * Gets the time from the start of the scene in seconds. * @param {gdjs.RuntimeScene} runtimeScene The runtime scene object. * @returns {number} The time in seconds since the scene started. */ function getTimeFromStartInSeconds(runtimeScene) { return runtimeScene.getTimeManager().getElapsedTimeInSeconds(); } ``` -------------------------------- ### Get Animation Elapsed Time (JavaScript) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/interfaces/gdjs.Animatable Returns the time that has elapsed since the start of the current animation, measured in seconds. This is a method of the Animatable interface. ```javascript /** * @returns {number} The elapsed time from the start of the animation in seconds. */ getAnimationElapsedTime(): number; ``` -------------------------------- ### PathfindingObstacleRuntimeBehavior Constructor Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.PathfindingObstacleRuntimeBehavior Initializes a new instance of PathfindingObstacleRuntimeBehavior. ```APIDOC ## new PathfindingObstacleRuntimeBehavior ### Description Initializes a new instance of the PathfindingObstacleRuntimeBehavior class. ### Method constructor ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "new PathfindingObstacleRuntimeBehavior(instanceContainer, behaviorData, owner)" } ``` ### Response #### Success Response (200) - **PathfindingObstacleRuntimeBehavior** (object) - The newly created PathfindingObstacleRuntimeBehavior instance. #### Response Example ```json { "example": "PathfindingObstacleRuntimeBehavior instance" } ``` ``` -------------------------------- ### Get Animation Elapsed Time - GDevelop JavaScript Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.SpriteAnimator Returns the time that has passed since the current animation started, measured in seconds. This is crucial for tracking animation progress. ```javascript getAnimationElapsedTime(): number ``` -------------------------------- ### ParticleEmitterObjectPixiRenderer Methods - Utility and Information (JavaScript) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.ParticleEmitterObjectPixiRenderer Offers utility functions for the particle emitter, such as computing lifetime, destroying the emitter, getting particle count, retrieving the renderer object, checking if it has started, and validating texture names. ```javascript computeLifetime(flow, tank): number destroy(): void getParticleCount(): number getRendererObject(): Container hasStarted(): boolean isTextureNameValid(texture, instanceContainer): boolean recreate(): void setPosition(x, y): void setHelperVisible(visible): void setZoneRadius(radius): void update(delta): void ``` -------------------------------- ### Function startQuery Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.evtTools.firebaseTools.firestore.startQuery Initiates a query over a specified collection in the database. ```APIDOC ## Function startQuery ### Description Initiate a query over a collection. ### Method N/A (This is a function signature, not an HTTP endpoint) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A (This function returns void) #### Response Example N/A ``` -------------------------------- ### LightRuntimeObject Class Documentation Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.LightRuntimeObject Detailed documentation for the LightRuntimeObject class, including its hierarchy, constructors, properties, and methods. ```APIDOC ## Class LightRuntimeObject Displays a Light object. #### Hierarchy * RuntimeObject * LightRuntimeObject ### Constructors #### constructor * `new LightRuntimeObject(runtimeScene, lightObjectData): LightRuntimeObject` * #### Parameters * `runtimeScene`: RuntimeScene * `lightObjectData`: LightObjectData #### Returns `LightRuntimeObject` ### Properties * **angle** `number` = 0 * **`Static` forcesGarbage** `Force[]` = [] Global container for unused forces, avoiding recreating forces each tick. #### Static * **`Static` getFirstVariableNumber** `((array) => number)` Shortcut to get the first value of an array variable as a number. #### Type declaration * `(array): number` * #### Parameters * `array`: Variable #### Returns `number` * **getFirstVariableNumber** `((array) => number)` Shortcut to get the first value of an array variable as a number. #### Type declaration * `(array): number` * #### Parameters * `array`: Variable #### Returns `number` * **`Static` getFirstVariableString** `((array) => string)` Shortcut to get the first value of an array variable as a string. #### Type declaration * `(array): string` * #### Parameters * `array`: Variable #### Returns `string` * **getFirstVariableString** `((array) => string)` Shortcut to get the first value of an array variable as a string. #### Type declaration * `(array): string` * #### Parameters * `array`: Variable #### Returns `string` * **getLastVariableNumber** `((array) => number)` * **getLastVariableNumber** `((array) => number)` * **getLastVariableString** `((array) => string)` * **getLastVariableString** `((array) => string)` * **getSqDistanceTo** `((object) => number)` * **getVariableBoolean** `((variableName) => boolean)` * **getVariableChildCount** `((variableName) => number)` * **getVariableNumber** `((variableName) => number)` * **getVariableString** `((variableName) => string)` * **hidden** `boolean` * **id** `string` * **layer** `string` * **name** `string` * **networkId** `string` * **persistentUuid** `string` * **pick** `((object) => boolean)` * **returnVariable** `((variableName) => Variable)` * **setVariableBoolean** `((variableName, value) => void)` * **setVariableNumber** `((variableName, value) => void)` * **setVariableString** `((variableName, value) => void)` * **supportsReinitialization** `boolean` * **toggleVariableBoolean** `((variableName) => void)` * **type** `string` * **valuePush** `((variableName, value) => void)` * **variableChildExists** `((variableName, childName) => boolean)` * **variableClearChildren** `((variableName) => void)` * **variablePushCopy** `((variableName, value) => void)` * **variableRemoveAt** `((variableName, index) => void)` * **variableRemoveChild** `((variableName, childName) => void)` * **x** `number` * **y** `number` * **zOrder** `number` * **aabb** `AABB` * **hitBoxes** `HitBox[]` * **hitBoxesDirty** `boolean` * **getVariableBoolean** `((variableName) => boolean)` * **setVariableBoolean** `((variableName, value) => void)` * **toggleVariableBoolean** `((variableName) => void)` * **valuePush** `((variableName, value) => void)` * **variablePushCopy** `((variableName, value) => void)` * **variableRemoveAt** `((variableName, index) => void)` * **variableRemoveChild** `((variableName, childName) => void)` ### Methods * **activateBehavior** `((behaviorName) => void)` * **addEffect** `((effectName, effectData) => void)` * **addForce** `((force) => void)` * **addForceTowardObject** `((object, maxForce, radius) => void)` * **addForceTowardPosition** `((x, y, maxForce, radius) => void)` * **addNewBehavior** `((behaviorName, behaviorData) => Behavior)` * **addPolarForce** `((angle, magnitude, radius) => void)` * **averageForceAngleIs** `((object) => number)` * **behaviorActivated** `((behaviorName) => boolean)` * **clearEffects** `(() => void)` * **clearForces** `(() => void)` * **collisionTest** `((object, onCollision) => boolean)` * **cursorOnObject** `((x, y) => boolean)` * **deleteFromScene** `(() => void)` * **distanceTest** `((object, maxDistance) => boolean)` * **enableEffect** `((effectName, enabled) => void)` * **extraInitializationFromInitialInstance** `((initialInstanceData) => void)` * **get3DRendererObject** `(() => any)` * **getAABB** `(() => AABB)` * **getAABBBottom** `(() => number)` * **getAABBCenterX** `(() => number)` * **getAABBCenterY** `(() => number)` * **getAABBLeft** `(() => number)` * **getAABBRight** `(() => number)` * **getAABBTop** `(() => number)` * **getAngle** `(() => number)` * **getAngleToObject** `((object) => number)` * **getAngleToPosition** `((x, y) => number)` * **getAverageForce** `(() => any)` * **getBehavior** `((behaviorName) => Behavior)` * **getCenterX** `(() => number)` * **getCenterXInScene** `(() => number)` * **getCenterY** `(() => number)` * **getCenterYInScene** `(() => number)` * **getColor** `(() => string)` * **getDebugMode** `(() => boolean)` * **getDistanceToObject** `((object) => number)` * **getDistanceToPosition** `((x, y) => number)` * **getDrawableX** `(() => number)` * **getDrawableY** `(() => number)` * **getElapsedTime** `(() => number)` * **getHeight** `(() => number)` * **getHitBoxes** `(() => HitBox[])` * **getInstanceContainer** `(() => RuntimeInstanceContainer)` * **getLayer** `(() => string)` * **getName** `(() => string)` * **getNameId** `(() => string)` * **getNameIdentifier** `(() => string)` * **getNetworkId** `(() => string)` * **getNetworkSyncData** `(() => any)` * **getObstaclesManager** `(() => ObstaclesManager)` * **getOriginalHeight** `(() => number)` * **getOriginalWidth** `(() => number)` * **getParent** `(() => RuntimeObject)` * **getRadius** `(() => number)` * **getRendererEffects** `(() => any)` * **getRendererObject** `(() => any)` * **getRuntimeScene** `(() => RuntimeScene)` * **getSqDistanceToObject** `((object) => number)` * **getSqDistanceToPosition** `((x, y) => number)` * **getTexture** `(() => string)` * **getTimerElapsedTimeInSeconds** `((timerName) => number)` * **getTimerElapsedTimeInSecondsOrNaN** `((timerName) => number)` * **getUniqueId** `(() => string)` * **getVariableChildCount** `((variableName) => number)` * **getVariableNumber** `((variableName) => number)` * **getVariableString** `((variableName) => string)` * **getVariables** `(() => VariablesContainer)` * **getVisibilityAABB** `(() => AABB)` * **getWidth** `(() => number)` * **getX** `(() => number)` * **getXFromAngleAndDistance** `((angle, distance) => number)` * **getY** `(() => number)` * **getYFromAngleAndDistance** `((angle, distance) => number)` * **getZOrder** `(() => number)` * **hasBehavior** `((behaviorName) => boolean)` * **hasEffect** `((effectName) => boolean)` * **hasNoForces** `(() => boolean)` * **hasVariable** `((variableName) => boolean)` * **hexToRGBColor** `((hex) => [number, number, number])` * **hide** `(() => void)` * **insideObject** `((x, y) => boolean)` * **invalidateHitboxes** `(() => void)` * **isCollidingWithPoint** `((x, y) => boolean)` * **isEffectEnabled** `((effectName) => boolean)` * **isHidden** `(() => boolean)` * **isIncludedInParentCollisionMask** `(() => boolean)` * **isOnLayer** `((layerName) => boolean)` * **isTotalForceAngleAround** `((object) => boolean)` * **isVisible** `(() => boolean)` * **notifyBehaviorsObjectHotReloaded** `(() => void)` * **onCreated** `(() => void)` * **onDeletedFromScene** `(() => void)` * **onDestroyed** `(() => void)` * **onScenePaused** `(() => void)` * **onSceneResumed** `(() => void)` * **pauseTimer** `((timerName) => void)` * **putAround** `((object, radius) => void)` * **putAroundObject** `((object, radius) => void)` * **raycastTest** `((x, y, maxLength, onHit) => boolean)` * **registerDestroyCallback** `((callback) => void)` * **reinitialize** `(() => void)` * **removeBehavior** `((behaviorName) => void)` * **removeEffect** `((effectName) => void)` * **removeTimer** `((timerName) => void)` * **resetTimer** `((timerName) => void)` * **returnVariable** `((variableName) => Variable)` * **rotate** `((angle) => void)` * **rotateTowardAngle** `((angle, maxSpeed) => void)` * **rotateTowardObject** `((object, maxSpeed) => void)` * **rotateTowardPosition** `((x, y, maxSpeed) => void)` * **separateFromObjects** `(() => void)` * **separateFromObjectsList** `((objects) => void)` * **separateObjectsWithForces** `(() => void)` * **separateObjectsWithoutForces** `(() => void)` * **setAngle** `((angle) => void)` * **setCenterPositionInScene** `((x, y) => void)` * **setCenterXInScene** `((x) => void)` * **setCenterYInScene** `((y) => void)` * **setColor** `((color) => void)` * **setEffectBooleanParameter** `((effectName, parameterName, value) => void)` * **setEffectDoubleParameter** `((effectName, parameterName, value) => void)` * **setEffectStringParameter** `((effectName, parameterName, value) => void)` * **setHeight** `((height) => void)` * **setIncludedInParentCollisionMask** `((include) => void)` * **setLayer** `((layer) => void)` * **setPosition** `((x, y) => void)` * **setRadius** `((radius) => void)` * **setVariableNumber** `((variableName, value) => void)` * **setVariableString** `((variableName, value) => void)` * **setWidth** `((width) => void)` * **setX** `((x) => void)` * **setY** `((y) => void)` * **setZOrder** `((zOrder) => void)` * **stepBehaviorsPostEvents** `(() => void)` * **stepBehaviorsPreEvents** `(() => void)` * **timerElapsedTime** `((timerName) => number)` * **timerPaused** `((timerName) => boolean)` * **unpauseTimer** `((timerName) => void)` * **unregisterDestroyCallback** `((callback) => void)` * **update** `(() => void)` * **updateAABB** `(() => void)` * **updateAllEffectParameters** `(() => void)` * **updateForces** `(() => void)` * **updateFromNetworkSyncData** `((data) => void)` * **updateFromObjectData** `((objectData) => void)` * **updateHitBoxes** `(() => void)` * **updatePreRender** `(() => void)` * **updateTimers** `(() => void)` ``` -------------------------------- ### Static: Get Name Identifier Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.CustomRuntimeObject2D Get the identifier associated with an object name. ```APIDOC ## POST /static/getNameIdentifier ### Description Gets the identifier associated with an object name. This can be more efficient for comparing object names multiple times. ### Method POST ### Endpoint /static/getNameIdentifier ### Parameters #### Request Body - **name** (string) - The name of the object. ### Request Example ```json { "name": "PlayerCharacter" } ``` ### Response #### Success Response (200) - **nameIdentifier** (number) - The identifier associated with the object name. #### Response Example ```json { "nameIdentifier": 98765 } ``` ``` -------------------------------- ### Static Method: Get Name Identifier Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.LightRuntimeObject A static method to get a numerical identifier for an object name, useful for performance-critical comparisons. ```APIDOC ## STATIC GET /object/name_identifier ### Description Gets a numerical identifier associated with an object name. This can be more efficient for repeated name comparisons. ### Method GET ### Endpoint /object/name_identifier ### Parameters #### Query Parameters - **name** (string) - Required - The name of the object to get the identifier for. ### Request Example None (uses query parameters) ### Response #### Success Response (200) - **nameIdentifier** (number) - The numerical identifier for the given object name. #### Response Example ```json { "nameIdentifier": 54321 } ``` ``` -------------------------------- ### Function startQueryFrom Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.evtTools.firebaseTools.firestore.startQueryFrom Creates a new query based on an existing source query. This is useful for building complex data retrieval logic by referencing and extending previous queries. ```APIDOC ## Function startQueryFrom ### Description Create a new query from a base query. ### Method (Not applicable - this is a function call within the JavaScript engine) ### Endpoint (Not applicable - this is a function call within the JavaScript engine) ### Parameters #### Path Parameters (None) #### Query Parameters (None) #### Request Body (None) ### Request Example ```javascript // Assuming 'gdjs' is the GDevelop JavaScript game engine object gdjs.evtTools.firebaseTools.startQueryFrom("newQueryName", "sourceQueryName"); ``` ### Response #### Success Response (void) This function does not return a value. #### Response Example (None) ``` -------------------------------- ### Variable Accessors (String) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.CustomRuntimeObject Provides functions to get the first or last value of an array variable as a string, or to get a variable's value as a string. ```APIDOC ## getFirstVariableString ### Description Shortcut to get the first value of an array variable as a string. ### Method GET (assumed, as it retrieves data) ### Endpoint `/variable/first/string` (assumed) ### Parameters #### Query Parameters - **array** (Variable) - Required - The array variable to access. ### Response #### Success Response (200) - **string** (string) - The first value of the array variable as a string. ## getLastVariableString ### Description Shortcut to get the last value of an array variable as a string. ### Method GET (assumed, as it retrieves data) ### Endpoint `/variable/last/string` (assumed) ### Parameters #### Query Parameters - **array** (Variable) - Required - The array variable to access. ### Response #### Success Response (200) - **string** (string) - The last value of the array variable as a string. ## getVariableString ### Description Get the value of a variable considered as a string. Equivalent of variable.getAsString(). ### Method GET (assumed, as it retrieves data) ### Endpoint `/variable/string` (assumed) ### Parameters #### Query Parameters - **variable** (Variable) - Required - The variable to be accessed. ### Response #### Success Response (200) - **string** (string) - The string of the specified variable. ``` -------------------------------- ### VideoRuntimeObjectPixiRenderer Constructor Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.VideoRuntimeObjectPixiRenderer Initializes a new instance of the VideoRuntimeObjectPixiRenderer. ```APIDOC ## constructor VideoRuntimeObjectPixiRenderer ### Description Initializes a new instance of the VideoRuntimeObjectPixiRenderer. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "runtimeObject": "VideoRuntimeObject", "instanceContainer": "RuntimeInstanceContainer" } ``` ### Response #### Success Response (200) - **VideoRuntimeObjectPixiRenderer** (object) - The newly created VideoRuntimeObjectPixiRenderer instance. #### Response Example ```json { "message": "VideoRuntimeObjectPixiRenderer initialized successfully" } ``` ``` -------------------------------- ### Variable Accessors (Number) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.CustomRuntimeObject Provides functions to get the first or last value of an array variable as a number, or to get a variable's value as a number. ```APIDOC ## getFirstVariableNumber ### Description Shortcut to get the first value of an array variable as a number. ### Method GET (assumed, as it retrieves data) ### Endpoint `/variable/first/number` (assumed) ### Parameters #### Query Parameters - **array** (Variable) - Required - The array variable to access. ### Response #### Success Response (200) - **number** (number) - The first value of the array variable as a number. ## getLastVariableNumber ### Description Shortcut to get the last value of an array variable as a number. ### Method GET (assumed, as it retrieves data) ### Endpoint `/variable/last/number` (assumed) ### Parameters #### Query Parameters - **array** (Variable) - Required - The array variable to access. ### Response #### Success Response (200) - **number** (number) - The last value of the array variable as a number. ## getVariableNumber ### Description Get the value of a variable considered as a number. Equivalent of variable.getAsNumber(). ### Method GET (assumed, as it retrieves data) ### Endpoint `/variable/number` (assumed) ### Parameters #### Query Parameters - **variable** (Variable) - Required - The variable to be accessed. ### Response #### Success Response (200) - **number** (number) - The value of the specified variable. ``` -------------------------------- ### makeDirectory Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.fileSystem.makeDirectory Creates a new directory at the specified path and stores the operation result in a variable. ```APIDOC ## makeDirectory ### Description Create a new directory at the given path. ### Method void (This is a function call, not a typical HTTP method) ### Endpoint N/A (Client-side JavaScript function) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```javascript // Assuming 'gdjs' is the GDevelop JavaScript game engine object // and 'Variable' is a GDevelop variable type gdjs.fileSystem.makeDirectory("path/to/new/directory", myResultVariable); ``` ### Response #### Success Response (void) This function returns void. The result of the operation (success or failure) is stored in the `resultVar`. #### Response Example ```javascript // Example of checking the result variable after calling makeDirectory // The actual structure of the result variable depends on GDevelop's implementation if (myResultVariable.getAsBoolean()) { console.log("Directory created successfully."); } else { console.error("Failed to create directory."); } ``` ``` -------------------------------- ### WebsocketDebuggerClient Constructor Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.WebsocketDebuggerClient Initializes a new instance of the WebsocketDebuggerClient. ```APIDOC ## constructor WebsocketDebuggerClient ### Description Initializes a new instance of the WebsocketDebuggerClient. ### Method CONSTRUCTOR ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```json { "runtimeGame": "RuntimeGame" } ``` ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Variable Type Conversion and Access Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.PanelSpriteRuntimeObject Functions to get and set variable values, treating them as booleans, numbers, or strings, and to get the number of children for complex variables. ```APIDOC ## getVariableBoolean ### Description Shortcut to compare the value of a variable considered as a boolean. ### Method GET ### Endpoint `/objects/{objectId}/variables/boolean` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. #### Query Parameters - **variable** (Variable) - Required - The variable to access. - **compareWith** (boolean) - Required - The boolean value to compare with. ### Response #### Success Response (200) - **result** (boolean) - True if the variable matches the `compareWith` value, false otherwise. #### Response Example ```json { "result": true } ``` ## getVariableChildCount ### Description Get the number of children from a variable. ### Method GET ### Endpoint `/objects/{objectId}/variables/childCount` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. #### Query Parameters - **variable** (Variable) - Required - The variable to be accessed. ### Response #### Success Response (200) - **count** (number) - The number of children of the variable. #### Response Example ```json { "count": 5 } ``` ## getVariableNumber ### Description Get the value of a variable considered as a number. ### Method GET ### Endpoint `/objects/{objectId}/variables/number` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. #### Query Parameters - **variable** (Variable) - Required - The variable to be accessed. ### Response #### Success Response (200) - **value** (number) - The value of the specified variable as a number. #### Response Example ```json { "value": 42 } ``` ## getVariableString ### Description Get the value of a variable considered as a string. ### Method GET ### Endpoint `/objects/{objectId}/variables/string` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. #### Query Parameters - **variable** (Variable) - Required - The variable to be accessed. ### Response #### Success Response (200) - **value** (string) - The value of the specified variable as a string. #### Response Example ```json { "value": "some text" } ``` ## setVariableBoolean ### Description Shortcut to set the value of a variable considered as a boolean. ### Method POST ### Endpoint `/objects/{objectId}/variables/boolean` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. #### Request Body - **variable** (Variable) - Required - The variable to set. - **newValue** (boolean) - Required - The new boolean value. ### Response #### Success Response (204) No content. ## setVariableNumber ### Description Shortcut to set the value of a variable considered as a number. ### Method POST ### Endpoint `/objects/{objectId}/variables/number` ### Parameters #### Path Parameters - **objectId** (string) - Required - The ID of the object. #### Request Body - **variable** (Variable) - Required - The variable to set. - **newValue** (number) - Required - The new number value. ### Response #### Success Response (204) No content. ``` -------------------------------- ### Behavior Creation Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.TweenRuntimeBehavior Method called when the behavior is created, after the owning object is fully initialized. Reimplement this to perform setup actions. ```javascript onCreated() ``` -------------------------------- ### Get Name Identifier by Name (Static) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.ParticleEmitterObject A static method to get the numerical identifier for a given object name string. This is useful for optimizing name comparisons in performance-critical code. ```javascript /** * Get the identifier associated to an object name. * @param {string} name The object name. * @returns {number} The object name identifier. */ RuntimeObject.getNameIdentifier(name) ``` -------------------------------- ### isReady() - GDevelop JavaScript Game Engine Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.evtTools.p2p.isReady Checks if the PeerJS library has finished its initialization process. This is crucial for ensuring that all networking functionalities are ready to be used. ```APIDOC ## isReady() ### Description Returns true once PeerJS finished initialization. ### Method GET ### Endpoint /isReady ### Parameters #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) - **isReady** (boolean) - True if PeerJS is initialized, false otherwise. #### Response Example { "isReady": true } ``` -------------------------------- ### CharacterCollisionChecker Methods: hasCollisionStartedWith Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.PhysicsCharacter3DRuntimeBehavior-1.CharacterCollisionChecker Checks if a collision with a specific RuntimeObject has started since the last update. Returns a boolean indicating if the collision started. ```javascript hasCollisionStartedWith(object): boolean ``` -------------------------------- ### useDefaultBrokerServer Function Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.multiplayerPeerJsHelper.useDefaultBrokerServer Internal function to initialize PeerJS after configuration. It takes optional initialization options. ```APIDOC ## Function useDefaultBrokerServer ### Description Internal function called to initialize PeerJS after it has been configured. ### Method `void` ### Endpoint N/A (Internal function) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (void) This function does not return a value. #### Response Example N/A ``` -------------------------------- ### Get Variable Child Count (Static) Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.BitmapTextRuntimeObject A static method to get the number of children a given variable has. This is useful for iterating through or inspecting complex variable structures. ```javascript /** * Get the number of children from a variable. * @param {Variable} variable The variable to be accessed. * @returns {number} The number of children. */ static getVariableChildCount(variable: Variable): number; ``` -------------------------------- ### getViewportWidth Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Gets the width of the viewport. ```APIDOC ## GET /viewport/width ### Description Get the width of the viewport. ### Method GET ### Endpoint /viewport/width ### Response #### Success Response (200) - **number** - The width of the viewport. ### Response Example ```json 800 ``` ``` -------------------------------- ### OpacityBehavior Class Documentation Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.OpacityBehavior Detailed documentation for the OpacityBehavior class, covering its inheritance, implemented interfaces, constructors, properties, and methods. ```APIDOC ## Class OpacityBehavior A behavior that forwards the Opacity interface to its object. #### Hierarchy * RuntimeBehavior * OpacityBehavior #### Implements * OpacityHandler ## Constructors ### constructor * `new OpacityBehavior(instanceContainer, behaviorData, owner)` * #### Parameters * `instanceContainer`: RuntimeInstanceContainer * `behaviorData`: any * `owner`: RuntimeObject & OpacityHandler * #### Returns * OpacityBehavior ## Properties ### name * `name`: string ### owner * `owner`: RuntimeObject * The object owning the behavior ### type * `type`: string ### `Private` object * `object`: RuntimeObject & OpacityHandler ## Methods ### activate * `activate(enable)` * De/Activate the behavior * #### Parameters * `enable`: boolean * true to enable the behavior, false to disable it * #### Returns * void ### activated * `activated()` * Return true if the behavior is activated * #### Returns * boolean ### doStepPostEvents * `doStepPostEvents(instanceContainer)` * This method is called each tick after events are done. * #### Parameters * `instanceContainer`: RuntimeInstanceContainer * The instanceContainer owning the object * #### Returns * void ### doStepPreEvents * `doStepPreEvents(instanceContainer)` * This method is called each tick before events are done. * #### Parameters * `instanceContainer`: RuntimeInstanceContainer * The instanceContainer owning the object * #### Returns * void ### enableSynchronization * `enableSynchronization(enable)` * #### Parameters * `enable`: boolean * #### Returns * void ### getName * `getName()` * Get the name of the behavior. * #### Returns * string * The behavior's name. ### getNameId * `getNameId()` * Get the name identifier of the behavior. * #### Returns * number * The behavior's name identifier. ### getNetworkSyncData * `getNetworkSyncData(syncOptions)` * #### Parameters * `syncOptions`: GetNetworkSyncDataOptions * #### Returns * BehaviorNetworkSyncData ### getOpacity * `getOpacity()` * Get the transparency of the object. * #### Returns * number * The opacity, between 0 (transparent) and 255 (opaque). ### isSyncedOverNetwork * `isSyncedOverNetwork()` * #### Returns * boolean ### onActivate * `onActivate()` * Reimplement this method to do extra work when the behavior is activated (after it has been deactivated, see `onDeActivate`). * #### Returns * void ### onCreated * `onCreated()` * Reimplement this to do extra work when the behavior is created (i.e: an object using it was created), after the object is fully initialized (so you can use `this.owner` without risk). * #### Returns * void ### onDeActivate * `onDeActivate()` * Reimplement this method to do extra work when the behavior is deactivated. * #### Returns * void ### onDestroy * `onDestroy()` * This method is called when the owner of the behavior is being removed from the scene and is about to be destroyed/reused later or when the behavior is removed from an object (can happen in case of hot-reloading only. Otherwise, behaviors are just de-activated, not removed. See `onDeActivate`). * #### Returns * void ### onObjectHotReloaded * `onObjectHotReloaded()` * This method is called when the owner of the behavior was hot reloaded, so its position, angle, size can have been changed outside of events. * #### Returns * void ### setOpacity * `setOpacity(opacity)` * Change the transparency of the object. * #### Parameters * `opacity`: number * The new opacity, between 0 (transparent) and 255 (opaque). * #### Returns * void ### stepPostEvents * `stepPostEvents(instanceContainer)` * Called at each frame after events. Call doStepPostEvents. Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead. * #### Parameters * `instanceContainer`: RuntimeInstanceContainer * The instanceContainer owning the object * #### Returns * void ### stepPreEvents * `stepPreEvents(instanceContainer)` * Called at each frame before events. Call doStepPreEvents. Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead. * #### Parameters * `instanceContainer`: RuntimeInstanceContainer * The instanceContainer owning the object * #### Returns * void ``` -------------------------------- ### getViewportHeight Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Gets the height of the viewport. ```APIDOC ## GET /viewport/height ### Description Get the height of the viewport. ### Method GET ### Endpoint /viewport/height ### Response #### Success Response (200) - **number** - The height of the viewport. ### Response Example ```json 600 ``` ``` -------------------------------- ### TileMapRuntimeObjectPixiRenderer Constructor Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.TileMapRuntimeObjectPixiRenderer Initializes a new instance of the TileMapRuntimeObjectPixiRenderer class. ```APIDOC ## constructor TileMapRuntimeObjectPixiRenderer ### Description Initializes a new instance of the TileMapRuntimeObjectPixiRenderer class. ### Method constructor ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ### Parameters * **runtimeObject** (SimpleTileMapRuntimeObject | TileMapRuntimeObject) - Required - The object to render * **instanceContainer** (RuntimeInstanceContainer) - Required - The gdjs.RuntimeScene in which the object is ### Returns TileMapRuntimeObjectPixiRenderer ``` -------------------------------- ### Get Name Identifier by Name Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.VideoRuntimeObject Gets the numerical identifier for a given object name. This is more efficient for repeated name comparisons than using the name string directly. ```typescript /** * Get the identifier associated to an object name. Some features may want to compare objects name a large number of time. In this case, it may be more efficient to compare objects name identifiers. * @param name The name of the object. * @returns The name identifier. */ static getNameIdentifier(name: string): number; ``` -------------------------------- ### getOpacity Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.SpriteRuntimeObject Gets the transparency level of the object. ```APIDOC ## GET /getOpacity ### Description Get the transparency of the object. ### Method GET ### Endpoint /getOpacity ### Response #### Success Response (200) - **number** - The opacity, between 0 (transparent) and 255 (opaque). #### Response Example ```json { "opacity": 128 } ``` ``` -------------------------------- ### AbstractDebuggerClient Constructor Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.AbstractDebuggerClient Initializes a new instance of the AbstractDebuggerClient class. ```APIDOC ## Constructor AbstractDebuggerClient ### Description Initializes a new instance of the AbstractDebuggerClient class. ### Method constructor ### Endpoint N/A ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example None ### Response #### Success Response (200) None #### Response Example None ``` -------------------------------- ### getUnrotatedViewportMinY Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Gets the top bound of the viewport. ```APIDOC ## GET /viewport/unrotated/min-y ### Description Get the top bound of the viewport. ### Method GET ### Endpoint /viewport/unrotated/min-y ### Response #### Success Response (200) - **number** - The top bound of the viewport. ### Response Example ```json 0 ``` ``` -------------------------------- ### SpineRuntimeObjectPixiRenderer Constructor Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.SpineRuntimeObjectPixiRenderer Initializes a new instance of the SpineRuntimeObjectPixiRenderer class. ```APIDOC ## new SpineRuntimeObjectPixiRenderer(runtimeObject, instanceContainer) ### Description Initializes a new instance of the SpineRuntimeObjectPixiRenderer class. ### Method CONSTRUCTOR ### Parameters #### Path Parameters - **runtimeObject** (SpineRuntimeObject) - Required - The object to render - **instanceContainer** (RuntimeInstanceContainer) - Required - The container in which the object is ### Returns SpineRuntimeObjectPixiRenderer ``` -------------------------------- ### useCustomBrokerServer Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/functions/gdjs.multiplayerPeerJsHelper.useCustomBrokerServer Connects the GDevelop JavaScript game engine to a custom PeerJS broker server for multiplayer functionalities. ```APIDOC ## Function useCustomBrokerServer ### Description Connects to a custom broker server. ### Method N/A (This is a function call within the JavaScript engine) ### Endpoint N/A ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example ```javascript useCustomBrokerServer("your_broker_host.com", 9000, "/your_path", "your_optional_key", true, { debug: true }); ``` ### Response #### Success Response (void) This function returns void, indicating successful execution. #### Response Example N/A ### Parameters Details * **host** (string) - Required - The host of the broker server. * **port** (number) - Required - The port of the broker server. * **path** (string) - Required - The path (part of the url after the host) to the broker server. * **key** (string) - Optional - Optional password to connect to the broker server. * **ssl** (boolean) - Required - Use ssl? * **peerJSInitOptions** (PeerJSInitOptions) - Optional - Options to initialize PeerJS. ### See PeerJSInitOptions ``` -------------------------------- ### getUnrotatedViewportMinX Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Gets the left bound of the viewport. ```APIDOC ## GET /viewport/unrotated/min-x ### Description Get the left bound of the viewport. ### Method GET ### Endpoint /viewport/unrotated/min-x ### Response #### Success Response (200) - **number** - The left bound of the viewport. ### Response Example ```json 0 ``` ``` -------------------------------- ### getUnrotatedViewportMaxY Source: https://docs.gdevelop.io/GDJS%20Runtime%20Documentation/classes/gdjs.RuntimeScene Gets the bottom bound of the viewport. ```APIDOC ## GET /viewport/unrotated/max-y ### Description Get the bottom bound of the viewport. ### Method GET ### Endpoint /viewport/unrotated/max-y ### Response #### Success Response (200) - **number** - The bottom bound of the viewport. ### Response Example ```json 600 ``` ```