From d16c13854a8257d722c60e67b1c7bc2e50393741 Mon Sep 17 00:00:00 2001 From: GDevelop documentation CI Date: Fri, 5 Jul 2024 00:11:47 +0000 Subject: [PATCH] Update documentation [skip ci] --- .../classes/gdjs.AbstractDebuggerClient.html | 24 +- .../classes/gdjs.AffineTransformation.html | 46 +- .../classes/gdjs.AnchorRuntimeBehavior.html | 34 +- .../classes/gdjs.AnimatableBehavior.html | 50 +- .../classes/gdjs.AsyncTask.html | 2 +- .../classes/gdjs.AsyncTasksManager.html | 6 +- .../classes/gdjs.BBTextRuntimeObject.html | 348 +++++++------- .../gdjs.BBTextRuntimeObjectPixiRenderer.html | 4 +- .../classes/gdjs.Base3DBehavior.html | 68 +-- .../classes/gdjs.BehaviorRBushAABB.html | 2 +- .../classes/gdjs.BitmapTextRuntimeObject.html | 358 +++++++-------- ...s.BitmapTextRuntimeObjectPixiRenderer.html | 6 +- .../classes/gdjs.Cube3DRuntimeObject.html | 392 ++++++++-------- .../classes/gdjs.CustomRuntimeObject.html | 378 ++++++++-------- .../classes/gdjs.CustomRuntimeObject2D.html | 378 ++++++++-------- ...djs.CustomRuntimeObject2DPixiRenderer.html | 6 +- .../classes/gdjs.CustomRuntimeObject3D.html | 422 ++++++++--------- .../gdjs.CustomRuntimeObject3DRenderer.html | 4 +- ....CustomRuntimeObjectInstanceContainer.html | 70 +-- .../classes/gdjs.DebuggerPixiRenderer.html | 4 +- .../gdjs.DestroyOutsideRuntimeBehavior.html | 38 +- .../gdjs.DraggableRuntimeBehavior.html | 34 +- ...js.DummyWithSharedDataRuntimeBehavior.html | 34 +- .../classes/gdjs.EffectBehavior.html | 44 +- .../classes/gdjs.FlippableBehavior.html | 34 +- .../gdjs.FontFaceObserverFontManager.html | 12 +- .../classes/gdjs.Force.html | 22 +- .../classes/gdjs.HotReloader.html | 6 +- .../classes/gdjs.HowlerSound.html | 46 +- .../classes/gdjs.HowlerSoundManager.html | 12 +- .../classes/gdjs.InGameDebugger.html | 2 +- .../classes/gdjs.InputManager.html | 64 +-- .../classes/gdjs.Inventory.html | 2 +- .../classes/gdjs.InventoryManager.html | 2 +- .../classes/gdjs.JsonManager.html | 14 +- .../classes/gdjs.Layer.html | 86 ++-- .../classes/gdjs.LayerPixiRenderer.html | 18 +- .../classes/gdjs.LightNightPixiFilter.html | 2 +- .../gdjs.LightObstacleRuntimeBehavior.html | 34 +- .../classes/gdjs.LightObstaclesManager.html | 10 +- .../classes/gdjs.LightRuntimeObject.html | 348 +++++++------- .../gdjs.LightRuntimeObjectPixiRenderer.html | 2 +- .../classes/gdjs.LinksManager.html | 8 +- .../classes/gdjs.Logger.html | 10 +- .../classes/gdjs.LongLivedObjectsList.html | 4 +- .../classes/gdjs.ManuallyResolvableTask.html | 4 +- .../classes/gdjs.Model3DManager.html | 10 +- .../classes/gdjs.Model3DRuntimeObject.html | 402 ++++++++--------- ...gdjs.MultiplayerObjectRuntimeBehavior.html | 34 +- .../classes/gdjs.NightPixiFilter.html | 2 +- .../classes/gdjs.OnceTriggers.html | 4 +- .../classes/gdjs.OpacityBehavior.html | 38 +- .../gdjs.PanelSpriteRuntimeObject.html | 358 +++++++-------- .../classes/gdjs.ParticleEmitterObject.html | 344 +++++++------- ...djs.ParticleEmitterObjectPixiRenderer.html | 2 +- ...js.PathfindingObstacleRuntimeBehavior.html | 34 +- .../gdjs.PathfindingObstaclesManager.html | 10 +- ...djs.PathfindingRuntimeBehavior-1.Node.html | 2 +- .../gdjs.PathfindingRuntimeBehavior.html | 44 +- .../classes/gdjs.Physics2RuntimeBehavior.html | 42 +- .../classes/gdjs.Physics2SharedData.html | 14 +- .../classes/gdjs.PhysicsRuntimeBehavior.html | 36 +- .../classes/gdjs.PhysicsSharedData.html | 4 +- .../classes/gdjs.PixiBitmapFontManager.html | 14 +- .../gdjs.PixiFiltersTools.EmptyFilter.html | 14 +- .../gdjs.PixiFiltersTools.PixiFilter.html | 16 +- ...js.PixiFiltersTools.PixiFilterCreator.html | 12 +- .../classes/gdjs.PixiImageManager.html | 26 +- .../classes/gdjs.PlatformObjectsManager.html | 10 +- .../classes/gdjs.PlatformRuntimeBehavior.html | 36 +- .../gdjs.PlatformerObjectRuntimeBehavior.html | 134 +++--- .../classes/gdjs.Polygon.html | 22 +- .../classes/gdjs.Profiler.html | 8 +- .../classes/gdjs.PromiseTask.html | 2 +- .../classes/gdjs.ResizableBehavior.html | 44 +- .../classes/gdjs.ResolveTask.html | 2 +- .../classes/gdjs.ResourceCache.html | 4 +- .../classes/gdjs.ResourceLoader.html | 42 +- .../classes/gdjs.RuntimeBehavior.html | 36 +- .../gdjs.RuntimeCustomObjectLayer.html | 86 ++-- .../classes/gdjs.RuntimeGame.html | 114 ++--- .../classes/gdjs.RuntimeGamePixiRenderer.html | 40 +- .../gdjs.RuntimeInstanceContainer.html | 70 +-- .../classes/gdjs.RuntimeLayer.html | 86 ++-- .../classes/gdjs.RuntimeObject.html | 340 +++++++------- .../classes/gdjs.RuntimeObject3D.html | 386 ++++++++-------- .../classes/gdjs.RuntimeObject3DRenderer.html | 2 +- .../classes/gdjs.RuntimeScene.html | 130 +++--- .../gdjs.RuntimeScenePixiRenderer.html | 8 +- .../classes/gdjs.ScalableBehavior.html | 46 +- .../classes/gdjs.SceneStack.html | 12 +- .../gdjs.ShapePainterRuntimeObject.html | 368 +++++++-------- .../classes/gdjs.ShopifyClientsManager.html | 2 +- .../classes/gdjs.SpineAtlasManager.html | 14 +- .../classes/gdjs.SpineManager.html | 10 +- .../classes/gdjs.SpineRuntimeObject.html | 372 +++++++-------- .../gdjs.SpineRuntimeObjectPixiRenderer.html | 4 +- .../classes/gdjs.SpriteAnimation.html | 4 +- .../gdjs.SpriteAnimationDirection.html | 4 +- .../classes/gdjs.SpriteAnimationFrame.html | 6 +- .../classes/gdjs.SpriteAnimator.html | 30 +- .../classes/gdjs.SpriteRuntimeObject.html | 400 ++++++++-------- .../gdjs.SpriteRuntimeObjectPixiRenderer.html | 8 +- .../classes/gdjs.TaskGroup.html | 4 +- .../classes/gdjs.TextContainerBehavior.html | 38 +- .../classes/gdjs.TextEntryRuntimeObject.html | 334 +++++++------- .../classes/gdjs.TextInputRuntimeObject.html | 358 +++++++-------- .../classes/gdjs.TextRuntimeObject.html | 426 +++++++++--------- ....TileMap.TileMapCollisionMaskRenderer.html | 2 +- .../gdjs.TileMap.TileMapRuntimeManager.html | 8 +- ...s.TileMap.TransformedCollisionTileMap.html | 34 +- ...eMap.TransformedCollisionTileMapLayer.html | 24 +- ...djs.TileMapCollisionMaskRuntimeObject.html | 364 +++++++-------- .../classes/gdjs.TileMapRuntimeObject.html | 354 +++++++-------- ...gdjs.TileMapRuntimeObjectPixiRenderer.html | 4 +- .../gdjs.TiledSpriteRuntimeObject.html | 366 +++++++-------- .../classes/gdjs.TimeManager.html | 12 +- .../classes/gdjs.Timer.html | 16 +- ...timeBehavior-1.IsometryTransformation.html | 4 +- ...Behavior-1.TopDownMovementHookContext.html | 4 +- .../gdjs.TopDownMovementRuntimeBehavior.html | 38 +- .../classes/gdjs.TweenRuntimeBehavior.html | 132 +++--- .../classes/gdjs.Variable.html | 90 ++-- .../classes/gdjs.VariablesContainer.html | 20 +- .../classes/gdjs.VideoRuntimeObject.html | 370 +++++++-------- .../gdjs.VideoRuntimeObjectPixiRenderer.html | 42 +- .../classes/gdjs.WebsocketDebuggerClient.html | 24 +- .../gdjs.WindowMessageDebuggerClient.html | 24 +- .../classes/gdjs.evtTools.p2p.Event.html | 10 +- .../classes/gdjs.evtTools.p2p.EventData.html | 4 +- .../gdjs.evtTools.runtimeScene.WaitTask.html | 4 +- ...s.multiplayerPeerJsHelper.MessageData.html | 2 +- ....multiplayerPeerJsHelper.MessagesList.html | 2 +- .../gdjs.watermark.RuntimeWatermark.html | 2 +- ...js.Cube3DRuntimeObject-1.MaterialType.html | 2 +- ...s.Model3DRuntimeObject-1.MaterialType.html | 2 +- .../enums/gdjs.RuntimeLayerCameraType.html | 2 +- .../enums/gdjs.RuntimeLayerRenderingType.html | 2 +- .../enums/gdjs.SceneChangeRequest.html | 2 +- .../interfaces/gdjs.Animatable.html | 18 +- .../gdjs.AnimationFrameTextureManager.html | 2 +- .../interfaces/gdjs.Base3DHandler.html | 34 +- .../interfaces/gdjs.Cube3DObjectData.html | 12 +- .../interfaces/gdjs.EffectHandler.html | 10 +- .../interfaces/gdjs.EffectsTarget.html | 2 +- .../interfaces/gdjs.Flippable.html | 2 +- .../gdjs.LightNightFilterExtra.html | 2 +- .../interfaces/gdjs.LoggerOutput.html | 2 +- .../interfaces/gdjs.Model3DObjectData.html | 12 +- .../interfaces/gdjs.Object3DData.html | 12 +- .../interfaces/gdjs.Object3DDataContent.html | 2 +- .../interfaces/gdjs.OpacityHandler.html | 4 +- .../gdjs.PathfindingNetworkSyncData.html | 2 +- .../gdjs.Physics2NetworkSyncData.html | 2 +- .../gdjs.PixiFiltersTools.Filter.html | 14 +- .../gdjs.PixiFiltersTools.FilterCreator.html | 2 +- .../gdjs.PlatformerObjectNetworkSyncData.html | 2 +- .../interfaces/gdjs.Resizable.html | 10 +- .../interfaces/gdjs.ResourceManager.html | 6 +- ....RuntimeInstanceContainerPixiRenderer.html | 2 +- .../interfaces/gdjs.Scalable.html | 12 +- .../interfaces/gdjs.TextContainer.html | 4 +- .../interfaces/gdjs.TextInputObjectData.html | 12 +- .../gdjs.TopDownMovementNetworkSyncData.html | 2 +- ...RuntimeBehavior-1.BasisTransformation.html | 2 +- ...RuntimeBehavior-1.TopDownMovementHook.html | 6 +- .../interfaces/gdjs.evtTools.p2p.IEvent.html | 2 +- .../gdjs.evtTools.p2p.IEventData.html | 2 +- .../gdjs.evtTools.tween.TimeSource.html | 2 +- ....multiplayerPeerJsHelper.IMessageData.html | 2 +- ...multiplayerPeerJsHelper.IMessagesList.html | 2 +- .../modules/gdjs.Base3DHandler-1.html | 2 +- .../modules/gdjs.PixiFiltersTools.html | 6 +- .../modules/gdjs.adMob.html | 32 +- .../modules/gdjs.deviceSensors.motion.html | 18 +- .../gdjs.deviceSensors.orientation.html | 14 +- .../modules/gdjs.deviceVibration.html | 6 +- .../modules/gdjs.evtTools.advancedWindow.html | 2 +- .../modules/gdjs.evtTools.camera.html | 16 +- .../modules/gdjs.evtTools.common.html | 70 +-- .../modules/gdjs.evtTools.debuggerTools.html | 6 +- .../gdjs.evtTools.exampleJsExtension.html | 2 +- .../gdjs.evtTools.facebookInstantGames.html | 2 +- ...gdjs.evtTools.firebaseTools.analytics.html | 6 +- .../gdjs.evtTools.firebaseTools.auth.html | 18 +- ...seTools.auth.userManagement.dangerous.html | 12 +- ...ols.firebaseTools.auth.userManagement.html | 26 +- .../gdjs.evtTools.firebaseTools.database.html | 20 +- ...gdjs.evtTools.firebaseTools.firestore.html | 42 +- ...gdjs.evtTools.firebaseTools.functions.html | 2 +- .../modules/gdjs.evtTools.firebaseTools.html | 2 +- ...js.evtTools.firebaseTools.performance.html | 8 +- ...s.evtTools.firebaseTools.remoteConfig.html | 4 +- .../gdjs.evtTools.firebaseTools.storage.html | 8 +- .../modules/gdjs.evtTools.input.html | 14 +- .../modules/gdjs.evtTools.inventory.html | 2 +- .../modules/gdjs.evtTools.leaderboards.html | 4 +- .../modules/gdjs.evtTools.linkedObjects.html | 2 +- .../modules/gdjs.evtTools.network.html | 10 +- .../modules/gdjs.evtTools.object.html | 18 +- .../modules/gdjs.evtTools.p2p.html | 56 +-- .../modules/gdjs.evtTools.platform.html | 2 +- .../modules/gdjs.evtTools.runtimeScene.html | 18 +- .../modules/gdjs.evtTools.shopify.html | 2 +- .../modules/gdjs.evtTools.sound.html | 2 +- .../modules/gdjs.evtTools.spatialSound.html | 2 +- .../modules/gdjs.evtTools.storage.html | 6 +- .../modules/gdjs.evtTools.string.html | 28 +- .../modules/gdjs.evtTools.systemInfo.html | 12 +- .../modules/gdjs.evtTools.tween.html | 32 +- .../modules/gdjs.evtTools.variable.html | 36 +- .../modules/gdjs.evtTools.window.html | 2 +- .../modules/gdjs.fileSystem.html | 44 +- GDJS Runtime Documentation/modules/gdjs.html | 128 +++--- .../modules/gdjs.multiplayer.html | 30 +- .../modules/gdjs.multiplayerComponents.html | 16 +- .../modules/gdjs.multiplayerPeerJsHelper.html | 24 +- .../modules/gdjs.pathfinding.html | 4 +- .../modules/gdjs.physics2.html | 2 +- .../modules/gdjs.playerAuthentication.html | 22 +- .../gdjs.playerAuthenticationComponents.html | 20 +- .../modules/gdjs.scene3d.camera.html | 2 +- .../modules/gdjs.screenshot.html | 2 +- .../modules/gdjs.steamworks.html | 2 +- 224 files changed, 6017 insertions(+), 6017 deletions(-) diff --git a/GDJS Runtime Documentation/classes/gdjs.AbstractDebuggerClient.html b/GDJS Runtime Documentation/classes/gdjs.AbstractDebuggerClient.html index 53dcabe7e..9a58ad711 100644 --- a/GDJS Runtime Documentation/classes/gdjs.AbstractDebuggerClient.html +++ b/GDJS Runtime Documentation/classes/gdjs.AbstractDebuggerClient.html @@ -1,48 +1,48 @@ AbstractDebuggerClient | GDevelop JavaScript game engine
Options
All
  • Public
  • Public/Protected
  • All
Menu

The base class describing a debugger client, that can be used to inspect a runtime game (dump its state) or alter it.

-

Hierarchy

Index

Methods

  • call(path: string[], args: any[]): boolean

Hierarchy

Index

Methods

  • call(path: string[], args: any[]): boolean
  • log(group: string, message: string, type: "info" | "warning" | "error", internal: boolean): void
  • log(group: string, message: string, type: "info" | "warning" | "error", internal: boolean): void
  • onUncaughtException(exception: Error): void
  • sendGamePaused(): void
  • onUncaughtException(exception: Error): void
  • sendGamePaused(): void
  • sendGameResumed(): void
  • sendGameResumed(): void

Returns void

  • sendProfilerStarted(): void

Returns void

  • sendProfilerStarted(): void
  • sendProfilerStopped(): void
  • sendProfilerStopped(): void
  • sendRuntimeGameDump(): void
  • sendRuntimeGameDump(): void
  • set(path: string[], newValue: any): boolean
  • set(path: string[], newValue: any): boolean
  • handleCommand(data: any): void
  • handleCommand(data: any): void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

An affine transformation that can transform points.

-

Hierarchy

  • AffineTransformation

Index

Methods

Hierarchy

  • AffineTransformation

Index

Methods

Returns void

Returns AffineTransformation

  • flipX(anchorX: number): void

Returns boolean

  • flipX(anchorX: number): void
  • flipY(anchorY: number): void

Returns void

  • flipY(anchorY: number): void

Returns void

  • isIdentity(): boolean
  • isIdentity(): boolean

Returns boolean

  • rotate(angle: number): void

Returns void

  • rotate(angle: number): void
  • rotateAround(angle: number, anchorX: number, anchorY: number): void

Returns void

  • rotateAround(angle: number, anchorX: number, anchorY: number): void
  • Concatenate a rotation.

    Parameters

    • angle: number

      The angle of rotation in radians.

      @@ -46,25 +46,25 @@

      The rotation anchor point X.

    • anchorY: number

      The rotation anchor point Y.

      -

    Returns void

  • scale(sx: number, sy: number): void

Returns void

  • scale(sx: number, sy: number): void
  • setToFlipX(anchorX: number): void

Returns void

  • setToFlipX(anchorX: number): void
  • setToFlipY(anchorY: number): void

Returns void

  • setToFlipY(anchorY: number): void
  • setToIdentity(): void

Returns void

  • setToIdentity(): void
  • setToRotation(theta: number): void
  • setToRotation(theta: number): void
  • setToRotationAround(angle: number, anchorX: number, anchorY: number): void
  • setToRotationAround(angle: number, anchorX: number, anchorY: number): void
  • Reset to a rotation.

    Parameters

    • angle: number

      The angle of rotation in radians.

      @@ -72,29 +72,29 @@

      The rotation anchor point X.

    • anchorY: number

      The rotation anchor point Y.

      -

    Returns void

  • setToScale(sx: number, sy: number): void

Returns void

  • setToScale(sx: number, sy: number): void
  • setToTranslation(tx: number, ty: number): void

Returns void

  • setToTranslation(tx: number, ty: number): void
  • toString(): string
  • transform(source: FloatPoint, destination: FloatPoint): void
  • toString(): string
  • transform(source: FloatPoint, destination: FloatPoint): void
  • Transform a point.

    Parameters

    • source: FloatPoint

      The point to transform.

    • destination: FloatPoint

      The Point to store the transformed coordinates.

      -

    Returns void

  • translate(tx: number, ty: number): void

Returns void

  • translate(tx: number, ty: number): void

Constructors

Returns void

Constructors

Properties

matrix: Float32Array

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Properties

HorizontalAnchor: { NONE: number; PROPORTIONAL: number; WINDOW_LEFT: number; WINDOW_RIGHT: number } = ...

Type declaration

  • NONE: number
  • PROPORTIONAL: number
  • WINDOW_LEFT: number
  • WINDOW_RIGHT: number
VerticalAnchor: { NONE: number; PROPORTIONAL: number; WINDOW_BOTTOM: number; WINDOW_TOP: number } = ...

Type declaration

  • NONE: number
  • PROPORTIONAL: number
  • WINDOW_BOTTOM: number
  • WINDOW_TOP: number
name: string
type: string

Methods

  • activate(enable: boolean): void
  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    -

    Returns boolean

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

A behavior that forwards the Animatable interface to its object.

-

Hierarchy

Implements

Index

Methods

  • activate(enable: boolean): void

Hierarchy

Implements

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean

Returns void

  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • getAnimationDuration(): number
  • getAnimationElapsedTime(): number
  • getAnimationIndex(): number
  • enableSynchronization(enable: boolean): void
  • getAnimationDuration(): number
  • getAnimationElapsedTime(): number
  • getAnimationIndex(): number
  • getAnimationName(): string
  • getAnimationName(): string
  • getAnimationSpeedScale(): number
  • getName(): string
  • getAnimationSpeedScale(): number
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • hasAnimationEnded(): boolean
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • hasAnimationEnded(): boolean
  • isAnimationPaused(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • isAnimationPaused(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void
  • pauseAnimation(): void
  • resumeAnimation(): void
  • setAnimationElapsedTime(time: number): void
  • pauseAnimation(): void
  • resumeAnimation(): void
  • setAnimationElapsedTime(time: number): void
  • setAnimationIndex(animationIndex: number): void
  • setAnimationIndex(animationIndex: number): void
  • setAnimationName(newAnimationName: string): void
  • setAnimationName(newAnimationName: string): void
  • setAnimationSpeedScale(ratio: number): void
  • setAnimationSpeedScale(ratio: number): void

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

An asynchronous task to be run between frames.

-

Hierarchy

Index

Constructors

Methods

Constructors

Methods

Hierarchy

Index

Constructors

Methods

Constructors

Methods

  • Called every frame where the scene is active.

    Parameters

    • runtimeScene: RuntimeScene

      The scene the task runs on.

      diff --git a/GDJS Runtime Documentation/classes/gdjs.AsyncTasksManager.html b/GDJS Runtime Documentation/classes/gdjs.AsyncTasksManager.html index 34d53f81e..c7f5a2437 100644 --- a/GDJS Runtime Documentation/classes/gdjs.AsyncTasksManager.html +++ b/GDJS Runtime Documentation/classes/gdjs.AsyncTasksManager.html @@ -2,15 +2,15 @@

      This stores all asynchronous tasks waiting to be completed, for a given scene.

      see

      RuntimeScene.getAsyncTasksManager.

      -

Hierarchy

  • AsyncTasksManager

Index

Methods

Hierarchy

  • AsyncTasksManager

Index

Methods

Returns void

Constructors

Properties

tasksWithCallback: { asyncTask: AsyncTask; callback: any }[] = ...
+

Parameters

Returns void

Constructors

Properties

tasksWithCallback: { asyncTask: AsyncTask; callback: any }[] = ...

Maps a task to the callback to be executed once it is finished.

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

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

-

Hierarchy

Implements

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void

Hierarchy

Implements

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void
  • addEffect(effectData: EffectData): boolean

Returns void

  • addEffect(effectData: EffectData): boolean
  • addForce(x: number, y: number, multiplier: number): void

Returns boolean

  • addForce(x: number, y: number, multiplier: number): void
  • Add a force to the object to move it.

    Parameters

    • x: number

      The x coordinates of the force

      @@ -18,7 +18,7 @@

      The y coordinates of the force

    • multiplier: number

      Set the force multiplier

      -

    Returns void

  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

Returns void

  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

Returns void

  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
  • addNewBehavior(behaviorData: BehaviorData): boolean

Returns void

  • addNewBehavior(behaviorData: BehaviorData): boolean
  • Create the behavior described by the given BehaviorData

    Parameters

    • behaviorData: BehaviorData

      The data to be used to construct the behavior.

    Returns boolean

    true if the behavior was properly created, false otherwise.

    -
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns boolean

true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

-
  • behaviorActivated(name: string): boolean
  • behaviorActivated(name: string): boolean
  • clearEffects(): boolean
  • clearEffects(): boolean
  • clearForces(): void
  • clearForces(): void
  • Return true if the hitboxes of two objects are overlapping

    static

    Parameters

    • obj1: RuntimeObject

      The first runtimeObject

      @@ -78,69 +78,69 @@
    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    Returns boolean

    true if obj1 and obj2 are in collision

    -

Returns void

  • enableEffect(name: string, enable: boolean): void
  • enableEffect(name: string, enable: boolean): void
  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

Returns void

  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
  • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
  • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
  • Get the AABB (axis aligned bounding box) for the object.

    The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

    You should probably redefine updateAABB instead of this function.

    Returns AABB

    The bounding box

    -
  • getAABBBottom(): number
  • getAABBBottom(): number
  • getAABBCenterX(): number
  • getAABBCenterX(): number
  • getAABBCenterY(): number
  • getAABBCenterY(): number
  • getAABBLeft(): number
  • getAABBLeft(): number
  • getAABBRight(): number
  • getAABBRight(): number
  • getAABBTop(): number
  • getAABBTop(): number
  • getAlignment(): string
  • getAngle(): number
  • getAlignment(): string
  • getAngle(): number
  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • getBBText(): string
  • getBBText(): string
  • Get a behavior from its name. If the behavior does not exists, undefined is returned.

    Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -148,61 +148,61 @@

    Parameters

    • name: string

      The behavior name.

    Returns null | RuntimeBehavior

    The behavior with the given name, or undefined.

    -
  • getCenterX(): number
  • getCenterX(): number
  • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

    Returns number

    the X position of the object center, relative to getDrawableX().

    -
  • getCenterXInScene(): number
  • getCenterXInScene(): number
  • getCenterY(): number
  • getCenterY(): number
  • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

    Returns number

    the Y position of the object center, relative to getDrawableY().

    -
  • getCenterYInScene(): number
  • getCenterYInScene(): number
  • getColor(): string
  • getColor(): string
  • getDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getDistanceToPosition(targetX: number, targetY: number): number
  • getDrawableX(): number

Returns number

  • getDrawableX(): number
  • Get the X position of the rendered object.

    For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

    Returns number

    The X position of the rendered object.

    -
  • getDrawableY(): number
  • getDrawableY(): number
  • Get the Y position of the rendered object.

    For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

    Returns number

    The Y position of the rendered object.

    -
  • getFontFamily(): string
  • getFontSize(): number
  • getHeight(): number

Returns number

  • getFontFamily(): string
  • getFontSize(): number
  • getHeight(): number
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • Return at least all the hit boxes that overlap a given area.

    The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -227,170 +227,170 @@

  • bottom: number

    bound of the area in scene coordinates

Returns Iterable<Polygon>

at least all the hit boxes that overlap a given area.

-
  • getLayer(): string
  • getLayer(): string
  • getName(): string
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNameIdentifier(name: string): number
  • getNameIdentifier(name: string): number
  • 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.

    -
    static

    Parameters

    • name: string

    Returns number

  • getOpacity(): number
  • getOpacity(): number
  • getRendererEffects(): Record<string, Filter>
  • getRendererEffects(): Record<string, Filter>
  • getRendererObject(): MultiStyleText
  • getRendererObject(): MultiStyleText
  • getSqDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getSqDistanceToPosition(targetX: number, targetY: number): number
  • getTimerElapsedTimeInSeconds(timerName: string): number

Returns number

  • getTimerElapsedTimeInSeconds(timerName: string): number
  • Get a timer elapsed time.

    This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

    Parameters

    • timerName: string

      The timer name.

    Returns number

    The timer elapsed time in seconds, 0 if the timer doesn't exist.

    -
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getUniqueId(): number
  • getUniqueId(): number
  • Get the unique identifier of the object.
    The identifier is set by the runtimeScene owning the object.
    You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

    Returns number

    The object identifier

    -
  • getVariableChildCount(variable: Variable): number
  • getVariableChildCount(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableString(variable: Variable): string
  • getVariableString(variable: Variable): string
  • getVisibilityAABB(): null | AABB
  • getVisibilityAABB(): null | AABB
  • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

    The default implementation uses the AABB returned by getAABB.

    If null is returned, the object is assumed to be always visible.

    Returns null | AABB

    The bounding box or null.

    -
  • getWidth(): number
  • getWidth(): number
  • getWordWrap(): boolean
  • getWrappingWidth(): number
  • getWordWrap(): boolean
  • getWrappingWidth(): number
  • getX(): number
  • getX(): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getY(): number

Returns number

  • getY(): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getZOrder(): number

Returns number

  • getZOrder(): number
  • hasBehavior(name: string): boolean
  • hasBehavior(name: string): boolean
  • hasEffect(name: string): boolean

Returns boolean

  • hasEffect(name: string): boolean
  • hasNoForces(): boolean
  • hasNoForces(): boolean
  • hasVariable(name: string): boolean
  • hasVariable(name: string): boolean
  • hide(enable: boolean): void
  • hide(enable: boolean): void
  • insideObject(x: number, y: number): boolean

Returns void

  • insideObject(x: number, y: number): boolean
  • Return true if the specified position is inside object bounding box.

    The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

    -

    Parameters

    • x: number
    • y: number

    Returns boolean

  • invalidateHitboxes(): void
  • invalidateHitboxes(): void
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isEffectEnabled(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isHidden(): boolean
  • isHidden(): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • Return true if the angle of the total force applied on the object is in a given range.

    Parameters

    • angle: number
      @@ -399,43 +399,43 @@

      The maximum distance from the given angle.

    Returns boolean

    true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

    -
  • isVisible(): boolean
  • isVisible(): boolean
  • Return true if the object is not hidden.

    Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

    Returns boolean

    true if the object is not hidden.

    -
  • notifyBehaviorsObjectHotReloaded(): void
  • notifyBehaviorsObjectHotReloaded(): void
  • onCreated(): void
  • onCreated(): void
  • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

    If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

    -

    Returns void

  • onDestroyed(): void

Returns void

  • onDestroyed(): void

Returns void

  • pauseTimer(timerName: string): void

Returns void

  • pauseTimer(timerName: string): void
  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

Returns void

  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
  • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

    Parameters

    • x: number
      @@ -446,7 +446,7 @@

      The distance between the object and the target, in pixels.

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
  • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

    Parameters

    • obj: null | RuntimeObject
      @@ -455,7 +455,7 @@

      The distance between the object and the target

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • registerDestroyCallback(callback: () => void): void
  • reinitialize(objectData: ObjectData): void
  • registerDestroyCallback(callback: () => void): void
  • reinitialize(objectData: ObjectData): void
  • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -481,7 +481,7 @@

  • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
-

Parameters

Returns void

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Returns boolean

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Returns void

Properties

angle: number = 0
forcesGarbage: Force[] = []
+

Returns void

Properties

angle: number = 0
forcesGarbage: Force[] = []

Global container for unused forces, avoiding recreating forces each tick.

-
static
getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableString: (array: Variable) => string = ...

Type declaration

getFirstVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableString: (array: Variable) => string = ...

Type declaration

getLastVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • +

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • Get the squared distance, in pixels, between the center of this object and a position.

      Parameters

      • targetX: number

        Target X position

      • targetY: number

        Target Y position

        -

      Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • +

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • Get the number of children from a variable

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The number of children

      -
getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

    • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The value of the specified variable

      -
getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

    • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns string

      The string of the specified variable

      -
hidden: boolean
id: number
layer: string = ''
name: string
networkId: null | string = null
+
hidden: boolean
id: number
layer: string = ''
name: string
networkId: null | string = null

A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

-
persistentUuid: null | string = null
+
persistentUuid: null | string = null

An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

-
pick: boolean = false
+
pick: boolean = false

A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

-
returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

    • Return the variable passed as argument without any change. Only for usage by events.

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns Variable

      The specified variable

      -
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • +

    Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • Shortcut to set the value of a variable considered as a number

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: number

        The value to be set

        -

      Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • +

    Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • Shortcut to set the value of a variable considered as a string

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: string

        The value to be set

        -

      Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • +

    Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable
        +

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable

        The variable to be tested

      • childName: string

        The name of the child

        -

      Returns boolean

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

    • static

      Parameters

      • variable: Variable

        The variable to be cleared

        -

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

      • variable: Variable

        The variable to be changed

      • childName: string

        The name of the child

        -

      Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • +

    Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

Constructors

Constructors

  • Parameters

    • instanceContainer: RuntimeInstanceContainer

      The container the object belongs to.

    • objectData: BBTextObjectData

      The object data used to initialize the object

      diff --git a/GDJS Runtime Documentation/classes/gdjs.BBTextRuntimeObjectPixiRenderer.html b/GDJS Runtime Documentation/classes/gdjs.BBTextRuntimeObjectPixiRenderer.html index c8470aa65..8d93dd0d5 100644 --- a/GDJS Runtime Documentation/classes/gdjs.BBTextRuntimeObjectPixiRenderer.html +++ b/GDJS Runtime Documentation/classes/gdjs.BBTextRuntimeObjectPixiRenderer.html @@ -1,10 +1,10 @@ BBTextRuntimeObjectPixiRenderer | GDevelop JavaScript game engine
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      The PIXI.js renderer for the BBCode Text runtime object.

      -

      Hierarchy

      • BBTextRuntimeObjectPixiRenderer

      Index

      Constructors

      Hierarchy

      • BBTextRuntimeObjectPixiRenderer

      Index

      Constructors

      Methods

      • destroy(): void
      • getHeight(): number
      • getRendererObject(): MultiStyleText
      • getWidth(): number
      • updateAlignment(): void
      • updateAngle(): void
      • updateColor(): void
      • updateFontFamily(): void
      • updateFontSize(): void
      • updateOpacity(): void
      • updatePosition(): void
      • updateText(): void
      • updateWordWrap(): void
      • updateWrappingWidth(): void

      Legend

      • Constructor
      • Method

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      A behavior that forwards the Base3D interface to its object.

      -

      Hierarchy

      Implements

      Index

      Methods

      • activate(enable: boolean): void

      Hierarchy

      Implements

      Index

      Methods

      • activate(enable: boolean): void
      • activated(): boolean

      Returns void

  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • flipZ(enable: boolean): void
  • getCenterZInScene(): number
  • enableSynchronization(enable: boolean): void
  • flipZ(enable: boolean): void
  • getCenterZInScene(): number
  • getDepth(): number
  • getDepth(): number
  • getName(): string
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • getRotationX(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • getRotationX(): number
  • getRotationY(): number
  • getRotationY(): number
  • getScaleZ(): number
  • getScaleZ(): number
  • getUnrotatedAABBMaxZ(): number
  • getUnrotatedAABBMaxZ(): number
  • getUnrotatedAABBMinZ(): number
  • getUnrotatedAABBMinZ(): number
  • getZ(): number
  • getZ(): number
  • isFlippedZ(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • isFlippedZ(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void
  • setCenterZInScene(z: number): void
  • setCenterZInScene(z: number): void
  • setDepth(depth: number): void
  • setDepth(depth: number): void
  • setRotationX(angle: number): void
  • setRotationX(angle: number): void
  • setRotationY(angle: number): void
  • setRotationY(angle: number): void
  • setScaleZ(newScale: number): void
  • setScaleZ(newScale: number): void
  • setZ(z: number): void
  • setZ(z: number): void

Returns void

  • turnAroundX(deltaAngle: number): void

Returns void

  • turnAroundX(deltaAngle: number): void
  • turnAroundY(deltaAngle: number): void
  • turnAroundY(deltaAngle: number): void
  • turnAroundZ(deltaAngle: number): void
  • turnAroundZ(deltaAngle: number): void
  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.

    Parameters

    • oldBehaviorData: any
    • newBehaviorData: any

    Returns boolean

    true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

    -
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    -

    Returns boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

The PIXI.js renderer for the Bitmap Text runtime object.

-

Hierarchy

  • BitmapTextRuntimeObjectPixiRenderer

Index

Constructors

Hierarchy

  • BitmapTextRuntimeObjectPixiRenderer

Index

Constructors

Methods

  • getFontSize(): number
  • getHeight(): number
  • getRendererObject(): BitmapText
  • getScale(): number
  • getTint(): string

Returns BitmapTextRuntimeObjectPixiRenderer

Methods

  • getFontSize(): number
  • getHeight(): number
  • getRendererObject(): BitmapText
  • getScale(): number
  • getTint(): string
  • getWidth(): number
  • onDestroy(): void
  • updateAlignment(): void
  • updateAngle(): void
  • updateFont(): void
  • updateOpacity(): void
  • updatePosition(): void
  • updateScale(): void
  • updateTextContent(): void
  • updateTint(): void
  • updateWrappingWidth(): void

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Shows a 3D box object.

-

Hierarchy

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void

Hierarchy

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void
  • addEffect(effectData: EffectData): boolean

Returns void

  • addEffect(effectData: EffectData): boolean
  • addForce(x: number, y: number, multiplier: number): void

Returns boolean

  • addForce(x: number, y: number, multiplier: number): void
  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

Returns void

  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

Returns void

  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
  • addNewBehavior(behaviorData: BehaviorData): boolean

Returns void

  • addNewBehavior(behaviorData: BehaviorData): boolean
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns boolean

true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

-
  • behaviorActivated(name: string): boolean
  • behaviorActivated(name: string): boolean
  • clearEffects(): boolean
  • clearEffects(): boolean
  • clearForces(): void
  • clearForces(): void
  • Return true if the hitboxes of two objects are overlapping

    static

    Parameters

    • obj1: RuntimeObject

      The first runtimeObject

      @@ -78,68 +78,68 @@
    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    Returns boolean

    true if obj1 and obj2 are in collision

    -

Returns void

  • enableEffect(name: string, enable: boolean): void
  • enableEffect(name: string, enable: boolean): void
  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

Returns void

  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • flipZ(enable: boolean): void
  • get3DRendererObject(): Object3D<Object3DEventMap>
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • flipZ(enable: boolean): void
  • get3DRendererObject(): Object3D<Object3DEventMap>
  • Get the AABB (axis aligned bounding box) for the object.

    The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

    You should probably redefine updateAABB instead of this function.

    Returns AABB

    The bounding box

    -
  • getAABBBottom(): number
  • getAABBBottom(): number
  • getAABBCenterX(): number
  • getAABBCenterX(): number
  • getAABBCenterY(): number
  • getAABBCenterY(): number
  • getAABBLeft(): number
  • getAABBLeft(): number
  • getAABBRight(): number
  • getAABBRight(): number
  • getAABBTop(): number
  • getAABBTop(): number
  • getAngle(): number
  • getAngle(): number
  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • getBackFaceUpThroughWhichAxisRotation(): "Y" | "X"
  • getBackFaceUpThroughWhichAxisRotation(): "Y" | "X"
  • Get a behavior from its name. If the behavior does not exists, undefined is returned.

    Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -147,75 +147,75 @@

    Parameters

    • name: string

      The behavior name.

    Returns null | RuntimeBehavior

    The behavior with the given name, or undefined.

    -
  • getCenterX(): number
  • getCenterX(): number
  • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

    Returns number

    the X position of the object center, relative to getDrawableX().

    -
  • getCenterXInScene(): number
  • getCenterXInScene(): number
  • getCenterY(): number
  • getCenterY(): number
  • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

    Returns number

    the Y position of the object center, relative to getDrawableY().

    -
  • getCenterYInScene(): number
  • getCenterYInScene(): number
  • getCenterZ(): number
  • getCenterZ(): number
  • Return the Z position of the object center, relative to the object Z position (getDrawableX).

    Use getCenterZInScene to get the position of the center in the scene.

    Returns number

    the Z position of the object center, relative to getDrawableZ().

    -
  • getCenterZInScene(): number
  • getCenterZInScene(): number
  • getDepth(): number
  • getDepth(): number
  • getDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getDistanceToPosition(targetX: number, targetY: number): number
  • getDrawableX(): number

Returns number

  • getDrawableX(): number
  • Get the X position of the rendered object.

    For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

    Returns number

    The X position of the rendered object.

    -
  • getDrawableY(): number
  • getDrawableY(): number
  • Get the Y position of the rendered object.

    For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

    Returns number

    The Y position of the rendered object.

    -
  • getDrawableZ(): number
  • getDrawableZ(): number
  • Get the Z position of the rendered object.

    For most objects, this will returns the same value as getZ(). But if the object has an origin that is not the same as the point (0,0,0) of the object displayed, getDrawableZ will differ.

    Returns number

    The Z position of the rendered object.

    -
  • getFacesOrientation(): "Y" | "Z"
  • getHeight(): number

Returns number

  • getFacesOrientation(): "Y" | "Z"
  • getHeight(): number
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • Return at least all the hit boxes that overlap a given area.

    The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -240,191 +240,191 @@

  • bottom: number

    bound of the area in scene coordinates

Returns Iterable<Polygon>

at least all the hit boxes that overlap a given area.

-
  • getLayer(): string
  • getLayer(): string
  • getName(): string
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNameIdentifier(name: string): number
  • getNameIdentifier(name: string): number
  • 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.

    -
    static

    Parameters

    • name: string

    Returns number

  • getNetworkSyncData(): Cube3DObjectNetworkSyncData
  • getNetworkSyncData(): Cube3DObjectNetworkSyncData
  • getRendererEffects(): Record<string, Filter>
  • getRendererEffects(): Record<string, Filter>
  • getRendererObject(): null
  • getRotationX(): number
  • getRendererObject(): null
  • getRotationX(): number
  • getRotationY(): number
  • getRotationY(): number
  • getScale(): number
  • getScale(): number
  • Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).

    Returns number

    the scale of the object (or the geometric average of X, Y and Z scale in case they are different).

    -
  • getScaleX(): number
  • getScaleX(): number
  • getScaleY(): number
  • getScaleY(): number
  • getScaleZ(): number
  • getScaleZ(): number
  • getSqDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getSqDistanceToPosition(targetX: number, targetY: number): number
  • getTimerElapsedTimeInSeconds(timerName: string): number

Returns number

  • getTimerElapsedTimeInSeconds(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getUniqueId(): number
  • getUniqueId(): number
  • Get the unique identifier of the object.
    The identifier is set by the runtimeScene owning the object.
    You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

    Returns number

    The object identifier

    -
  • getUnrotatedAABBMaxZ(): number
  • getUnrotatedAABBMaxZ(): number
  • getUnrotatedAABBMinZ(): number
  • getUnrotatedAABBMinZ(): number
  • getVariableChildCount(variable: Variable): number
  • getVariableChildCount(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableString(variable: Variable): string
  • getVariableString(variable: Variable): string
  • getVisibilityAABB(): null | AABB
  • getVisibilityAABB(): null | AABB
  • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

    The default implementation uses the AABB returned by getAABB.

    If null is returned, the object is assumed to be always visible.

    Returns null | AABB

    The bounding box or null.

    -
  • getWidth(): number
  • getWidth(): number
  • getX(): number
  • getX(): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getY(): number

Returns number

  • getY(): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getZ(): number

Returns number

  • getZ(): number
  • getZOrder(): number
  • getZOrder(): number
  • hasBehavior(name: string): boolean
  • hasBehavior(name: string): boolean
  • hasEffect(name: string): boolean

Returns boolean

  • hasEffect(name: string): boolean
  • hasNoForces(): boolean
  • hasNoForces(): boolean
  • hasVariable(name: string): boolean
  • hasVariable(name: string): boolean
  • hide(enable: boolean): void
  • hide(enable: boolean): void
  • insideObject(x: number, y: number): boolean
  • insideObject(x: number, y: number): boolean
  • Return true if the specified position is inside object bounding box.

    The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

    -

    Parameters

    • x: number
    • y: number

    Returns boolean

  • invalidateHitboxes(): void
  • invalidateHitboxes(): void
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isEffectEnabled(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isFaceVisible(faceName: FaceName): boolean
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isFlippedZ(): boolean
  • isHidden(): boolean
  • isFaceVisible(faceName: FaceName): boolean
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isFlippedZ(): boolean
  • isHidden(): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • Return true if the angle of the total force applied on the object is in a given range.

    Parameters

    • angle: number
      @@ -433,43 +433,43 @@

      The maximum distance from the given angle.

    Returns boolean

    true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

    -
  • isVisible(): boolean
  • isVisible(): boolean
  • Return true if the object is not hidden.

    Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

    Returns boolean

    true if the object is not hidden.

    -
  • notifyBehaviorsObjectHotReloaded(): void
  • notifyBehaviorsObjectHotReloaded(): void
  • onCreated(): void
  • onCreated(): void
  • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

    If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

    -

    Returns void

  • onDestroyed(): void

Returns void

  • onDestroyed(): void

Returns void

  • pauseTimer(timerName: string): void

Returns void

  • pauseTimer(timerName: string): void
  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

Returns void

  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
  • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

    Parameters

    • x: number
      @@ -480,7 +480,7 @@

      The distance between the object and the target, in pixels.

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
  • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

    Parameters

    • obj: null | RuntimeObject
      @@ -489,7 +489,7 @@

      The distance between the object and the target

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • registerDestroyCallback(callback: () => void): void
  • reinitialize(objectData: ObjectData): void
  • registerDestroyCallback(callback: () => void): void
  • reinitialize(objectData: ObjectData): void
  • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -515,7 +515,7 @@

  • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
-

Parameters

Returns void

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Returns boolean

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Returns void

Properties

angle: number = 0
forcesGarbage: Force[] = []
+

Returns void

Properties

angle: number = 0
forcesGarbage: Force[] = []

Global container for unused forces, avoiding recreating forces each tick.

-
static
getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableString: (array: Variable) => string = ...

Type declaration

getFirstVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableString: (array: Variable) => string = ...

Type declaration

getLastVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • +

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • Get the squared distance, in pixels, between the center of this object and a position.

      Parameters

      • targetX: number

        Target X position

      • targetY: number

        Target Y position

        -

      Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • +

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • Get the number of children from a variable

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The number of children

      -
getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

    • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The value of the specified variable

      -
getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

    • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns string

      The string of the specified variable

      -
hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null
+
hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null

A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

-
persistentUuid: null | string = null
+
persistentUuid: null | string = null

An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

-
pick: boolean = false
+
pick: boolean = false

A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

-
returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

    • Return the variable passed as argument without any change. Only for usage by events.

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns Variable

      The specified variable

      -
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • +

    Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • Shortcut to set the value of a variable considered as a number

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: number

        The value to be set

        -

      Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • +

    Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • Shortcut to set the value of a variable considered as a string

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: string

        The value to be set

        -

      Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • +

    Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable
        +

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable

        The variable to be tested

      • childName: string

        The name of the child

        -

      Returns boolean

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

    • static

      Parameters

      • variable: Variable

        The variable to be cleared

        -

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

      • variable: Variable

        The variable to be changed

      • childName: string

        The name of the child

        -

      Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • +

    Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for 2D custom objects.

-

Hierarchy

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void

Hierarchy

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void
  • addEffect(effectData: EffectData): boolean

Returns void

  • addEffect(effectData: EffectData): boolean
  • addForce(x: number, y: number, multiplier: number): void

Returns boolean

  • addForce(x: number, y: number, multiplier: number): void
  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

Returns void

  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

Returns void

  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
  • addNewBehavior(behaviorData: BehaviorData): boolean

Returns void

  • addNewBehavior(behaviorData: BehaviorData): boolean
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • applyObjectInverseTransformation(x: number, y: number, destination: FloatPoint): void

Returns void

  • applyObjectInverseTransformation(x: number, y: number, destination: FloatPoint): void
  • Return an array containing the coordinates of the point passed as parameter in object local coordinates (as opposed to the parent coordinate coordinates).

    All transformations (flipping, scale, rotation) are supported.

    @@ -58,7 +58,7 @@

    The X position of the point, in parent coordinates.

  • y: number

    The Y position of the point, in parent coordinates.

    -
  • destination: FloatPoint

Returns void

  • applyObjectTransformation(x: number, y: number, destination: FloatPoint): void

Returns void

  • applyObjectTransformation(x: number, y: number, destination: FloatPoint): void
  • Return an array containing the coordinates of the point passed as parameter in parent coordinate coordinates (as opposed to the object local coordinates).

    All transformations (flipping, scale, rotation) are supported.

    @@ -66,7 +66,7 @@

    The X position of the point, in object coordinates.

  • y: number

    The Y position of the point, in object coordinates.

    -
  • destination: FloatPoint

Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns boolean

true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

-
  • behaviorActivated(name: string): boolean
  • behaviorActivated(name: string): boolean
  • clearEffects(): boolean
  • clearEffects(): boolean
  • clearForces(): void
  • clearForces(): void
  • Return true if the hitboxes of two objects are overlapping

    static

    Parameters

    • obj1: RuntimeObject

      The first runtimeObject

      @@ -94,75 +94,75 @@
    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    Returns boolean

    true if obj1 and obj2 are in collision

    -

Returns void

  • enableEffect(name: string, enable: boolean): void

Returns void

  • enableEffect(name: string, enable: boolean): void
  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

Returns void

  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
  • Get the AABB (axis aligned bounding box) for the object.

    The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

    You should probably redefine updateAABB instead of this function.

    Returns AABB

    The bounding box

    -
  • getAABBBottom(): number
  • getAABBBottom(): number
  • getAABBCenterX(): number
  • getAABBCenterX(): number
  • getAABBCenterY(): number
  • getAABBCenterY(): number
  • getAABBLeft(): number
  • getAABBLeft(): number
  • getAABBRight(): number
  • getAABBRight(): number
  • getAABBTop(): number
  • getAABBTop(): number
  • getAngle(): number
  • getAngle(): number
  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • Get a behavior from its name. If the behavior does not exists, undefined is returned.

    Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -170,59 +170,59 @@

    Parameters

    • name: string

      The behavior name.

    Returns null | RuntimeBehavior

    The behavior with the given name, or undefined.

    -
  • getCenterX(): number
  • getCenterX(): number
  • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

    Returns number

    the X position of the object center, relative to getDrawableX().

    -
  • getCenterXInScene(): number
  • getCenterXInScene(): number
  • getCenterY(): number
  • getCenterY(): number
  • getCenterYInScene(): number
  • getCenterYInScene(): number
  • getDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getDistanceToPosition(targetX: number, targetY: number): number
  • getDrawableX(): number

Returns number

  • getDrawableX(): number
  • Get the X position of the rendered object.

    For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

    Returns number

    The X position of the rendered object.

    -
  • getDrawableY(): number
  • getDrawableY(): number
  • Get the Y position of the rendered object.

    For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

    Returns number

    The Y position of the rendered object.

    -
  • getHeight(): number

Returns number

  • getHeight(): number
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • Return at least all the hit boxes that overlap a given area.

    The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -247,191 +247,191 @@

  • bottom: number

    bound of the area in scene coordinates

Returns Iterable<Polygon>

at least all the hit boxes that overlap a given area.

-
  • getLayer(): string
  • getLayer(): string
  • getName(): string
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNameIdentifier(name: string): number
  • getNameIdentifier(name: string): number
  • getNetworkSyncData(): ObjectNetworkSyncData
  • getNetworkSyncData(): ObjectNetworkSyncData
  • getOpacity(): number
  • getOpacity(): number
  • getRendererEffects(): Record<string, Filter>
  • getRendererEffects(): Record<string, Filter>
  • getRendererObject(): Container<DisplayObject>
  • getRendererObject(): Container<DisplayObject>
  • getScale(): number
  • getScale(): number
  • getScaleMean(): number
  • getScaleMean(): number
  • getScaleX(): number
  • getScaleX(): number
  • getScaleY(): number
  • getScaleY(): number
  • getSqDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getSqDistanceToPosition(targetX: number, targetY: number): number
  • getTimerElapsedTimeInSeconds(timerName: string): number

Returns number

  • getTimerElapsedTimeInSeconds(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getUniqueId(): number
  • getUniqueId(): number
  • Get the unique identifier of the object.
    The identifier is set by the runtimeScene owning the object.
    You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

    Returns number

    The object identifier

    -
  • getUnscaledCenterX(): number
  • getUnscaledCenterY(): number
  • getUnscaledHeight(): number
  • getUnscaledWidth(): number
  • getVariableChildCount(variable: Variable): number
  • getUnscaledCenterX(): number
  • getUnscaledCenterY(): number
  • getUnscaledHeight(): number
  • getUnscaledWidth(): number
  • getVariableChildCount(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableString(variable: Variable): string
  • getVariableString(variable: Variable): string
  • getVisibilityAABB(): null | AABB
  • getVisibilityAABB(): null | AABB
  • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

    The default implementation uses the AABB returned by getAABB.

    If null is returned, the object is assumed to be always visible.

    Returns null | AABB

    The bounding box or null.

    -
  • getWidth(): number
  • getWidth(): number
  • getX(): number
  • getX(): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getY(): number

Returns number

  • getY(): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getZOrder(): number

Returns number

  • getZOrder(): number
  • hasBehavior(name: string): boolean
  • hasBehavior(name: string): boolean
  • hasCustomRotationCenter(): boolean
  • hasEffect(name: string): boolean

Returns boolean

  • hasCustomRotationCenter(): boolean
  • hasEffect(name: string): boolean
  • hasNoForces(): boolean
  • hasNoForces(): boolean
  • hasVariable(name: string): boolean
  • hasVariable(name: string): boolean
  • hide(enable: boolean): void
  • hide(enable: boolean): void
  • insideObject(x: number, y: number): boolean

Returns void

  • insideObject(x: number, y: number): boolean
  • Return true if the specified position is inside object bounding box.

    The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

    -

    Parameters

    • x: number
    • y: number

    Returns boolean

  • invalidateHitboxes(): void
  • invalidateHitboxes(): void
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isEffectEnabled(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isHidden(): boolean
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isHidden(): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • Return true if the angle of the total force applied on the object is in a given range.

    Parameters

    • angle: number
      @@ -440,46 +440,46 @@

      The maximum distance from the given angle.

    Returns boolean

    true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

    -
  • isVisible(): boolean
  • isVisible(): boolean
  • Return true if the object is not hidden.

    Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

    Returns boolean

    true if the object is not hidden.

    -
  • notifyBehaviorsObjectHotReloaded(): void
  • notifyBehaviorsObjectHotReloaded(): void
  • onChildrenLocationChanged(): void
  • onCreated(): void
  • onChildrenLocationChanged(): void
  • onCreated(): void
  • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

    If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

    -

    Returns void

  • onDestroyed(): void
  • onDestroyed(): void

Returns void

  • pauseTimer(timerName: string): void

Returns void

  • pauseTimer(timerName: string): void
  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

Returns void

  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
  • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

    Parameters

    • x: number
      @@ -490,7 +490,7 @@

      The distance between the object and the target, in pixels.

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
  • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

    Parameters

    • obj: null | RuntimeObject
      @@ -499,7 +499,7 @@

      The distance between the object and the target

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • registerDestroyCallback(callback: () => void): void
  • registerDestroyCallback(callback: () => void): void
  • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -525,7 +525,7 @@

  • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
-

Parameters

Returns void

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Returns boolean

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Properties

angle: number = 0
forcesGarbage: Force[] = []
+

Returns void

Properties

angle: number = 0
forcesGarbage: Force[] = []

Global container for unused forces, avoiding recreating forces each tick.

-
static
getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableString: (array: Variable) => string = ...

Type declaration

getFirstVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableString: (array: Variable) => string = ...

Type declaration

getLastVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • +

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • Get the squared distance, in pixels, between the center of this object and a position.

      Parameters

      • targetX: number

        Target X position

      • targetY: number

        Target Y position

        -

      Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • +

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • Get the number of children from a variable

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The number of children

      -
getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

    • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The value of the specified variable

      -
getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

    • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns string

      The string of the specified variable

      -
hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null
+
hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null

A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

-
persistentUuid: null | string = null
+
persistentUuid: null | string = null

An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

-
pick: boolean = false
+
pick: boolean = false

A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

-
returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

    • Return the variable passed as argument without any change. Only for usage by events.

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns Variable

      The specified variable

      -
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • +

    Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • Shortcut to set the value of a variable considered as a number

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: number

        The value to be set

        -

      Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • +

    Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • Shortcut to set the value of a variable considered as a string

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: string

        The value to be set

        -

      Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • +

    Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable
        +

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable

        The variable to be tested

      • childName: string

        The name of the child

        -

      Returns boolean

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

    • static

      Parameters

      • variable: Variable

        The variable to be cleared

        -

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

      • variable: Variable

        The variable to be changed

      • childName: string

        The name of the child

        -

      Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • +

    Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

The renderer for a gdjs.CustomRuntimeObject2D using Pixi.js.

-

Hierarchy

  • CustomRuntimeObject2DPixiRenderer

Implements

Index

Constructors

Methods

  • ensureUpToDate(): void

Hierarchy

  • CustomRuntimeObject2DPixiRenderer

Implements

Index

Constructors

Methods

  • ensureUpToDate(): void
  • get3DRendererObject(): null | Object3D<Object3DEventMap>
  • getAnimationFrameTextureManager(imageManager: PixiImageManager): PixiAnimationFrameTextureManager
  • getPIXIContainer(): Container<DisplayObject>
  • getPIXIRenderer(): null
  • getRendererObject(): Container<DisplayObject>
  • get3DRendererObject(): null | Object3D<Object3DEventMap>
  • getAnimationFrameTextureManager(imageManager: PixiImageManager): PixiAnimationFrameTextureManager
  • getPIXIContainer(): Container<DisplayObject>
  • getPIXIRenderer(): null
  • getRendererObject(): Container<DisplayObject>
  • update(): void
  • updateAngle(): void
  • updateOpacity(): void
  • updateVisibility(): void
  • updateX(): void
  • updateY(): void

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Base class for 3D custom objects.

-

Hierarchy

Implements

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void

Hierarchy

Implements

Index

Methods

Properties

Constructors

Methods

  • activateBehavior(name: string, enable: boolean): void
  • addEffect(effectData: EffectData): boolean

Returns void

  • addEffect(effectData: EffectData): boolean
  • addForce(x: number, y: number, multiplier: number): void

Returns boolean

  • addForce(x: number, y: number, multiplier: number): void
  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

Returns void

  • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

Returns void

  • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
  • addNewBehavior(behaviorData: BehaviorData): boolean

Returns void

  • addNewBehavior(behaviorData: BehaviorData): boolean
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • addPolarForce(angle: number, len: number, multiplier: number): void
  • applyObjectInverseTransformation(x: number, y: number, destination: FloatPoint): void

Returns void

  • applyObjectInverseTransformation(x: number, y: number, destination: FloatPoint): void
  • Return an array containing the coordinates of the point passed as parameter in object local coordinates (as opposed to the parent coordinate coordinates).

    All transformations (flipping, scale, rotation) are supported.

    @@ -58,7 +58,7 @@

    The X position of the point, in parent coordinates.

  • y: number

    The Y position of the point, in parent coordinates.

    -
  • destination: FloatPoint

Returns void

  • applyObjectTransformation(x: number, y: number, destination: FloatPoint): void

Returns void

  • applyObjectTransformation(x: number, y: number, destination: FloatPoint): void
  • Return an array containing the coordinates of the point passed as parameter in parent coordinate coordinates (as opposed to the object local coordinates).

    All transformations (flipping, scale, rotation) are supported.

    @@ -66,7 +66,7 @@

    The X position of the point, in object coordinates.

  • y: number

    The Y position of the point, in object coordinates.

    -
  • destination: FloatPoint

Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns void

  • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

Returns boolean

true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

-
  • behaviorActivated(name: string): boolean
  • behaviorActivated(name: string): boolean
  • clearEffects(): boolean
  • clearEffects(): boolean
  • clearForces(): void
  • clearForces(): void
  • Return true if the hitboxes of two objects are overlapping

    static

    Parameters

    • obj1: RuntimeObject

      The first runtimeObject

      @@ -94,75 +94,75 @@
    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

    Returns boolean

    true if obj1 and obj2 are in collision

    -

Returns void

  • enableEffect(name: string, enable: boolean): void

Returns void

  • enableEffect(name: string, enable: boolean): void
  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

Returns void

  • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • flipZ(enable: boolean): void
  • get3DRendererObject(): Object3D<Object3DEventMap>
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • flipZ(enable: boolean): void
  • get3DRendererObject(): Object3D<Object3DEventMap>
  • Get the AABB (axis aligned bounding box) for the object.

    The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

    You should probably redefine updateAABB instead of this function.

    Returns AABB

    The bounding box

    -
  • getAABBBottom(): number
  • getAABBBottom(): number
  • getAABBCenterX(): number
  • getAABBCenterX(): number
  • getAABBCenterY(): number
  • getAABBCenterY(): number
  • getAABBLeft(): number
  • getAABBLeft(): number
  • getAABBRight(): number
  • getAABBRight(): number
  • getAABBTop(): number
  • getAABBTop(): number
  • getAngle(): number
  • getAngle(): number
  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • getAngleToPosition(targetX: number, targetY: number): number

Returns number

  • Get a behavior from its name. If the behavior does not exists, undefined is returned.

    Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -170,75 +170,75 @@

    Parameters

    • name: string

      The behavior name.

    Returns null | RuntimeBehavior

    The behavior with the given name, or undefined.

    -
  • getCenterX(): number
  • getCenterX(): number
  • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

    Returns number

    the X position of the object center, relative to getDrawableX().

    -
  • getCenterXInScene(): number
  • getCenterXInScene(): number
  • getCenterY(): number
  • getCenterY(): number
  • getCenterYInScene(): number
  • getCenterYInScene(): number
  • getCenterZ(): number
  • getCenterZ(): number
  • Return the Z position of the object center, relative to the object Z position (getDrawableX).

    Use getCenterZInScene to get the position of the center in the scene.

    Returns number

    the Z position of the object center, relative to getDrawableZ().

    -
  • getCenterZInScene(): number
  • getCenterZInScene(): number
  • getDepth(): number
  • getDepth(): number
  • getDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getDistanceToPosition(targetX: number, targetY: number): number
  • getDrawableX(): number

Returns number

  • getDrawableX(): number
  • Get the X position of the rendered object.

    For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

    Returns number

    The X position of the rendered object.

    -
  • getDrawableY(): number
  • getDrawableY(): number
  • Get the Y position of the rendered object.

    For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

    Returns number

    The Y position of the rendered object.

    -
  • getDrawableZ(): number
  • getDrawableZ(): number
  • Get the Z position of the rendered object.

    For most objects, this will returns the same value as getZ(). But if the object has an origin that is not the same as the point (0,0,0) of the object displayed, getDrawableZ will differ.

    Returns number

    The Z position of the rendered object.

    -
  • getHeight(): number

Returns number

  • getHeight(): number
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
  • Return at least all the hit boxes that overlap a given area.

    The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -263,210 +263,210 @@

  • bottom: number

    bound of the area in scene coordinates

Returns Iterable<Polygon>

at least all the hit boxes that overlap a given area.

-
  • getLayer(): string
  • getLayer(): string
  • getName(): string
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNameIdentifier(name: string): number
  • getNameIdentifier(name: string): number
  • getNetworkSyncData(): ObjectNetworkSyncData
  • getNetworkSyncData(): ObjectNetworkSyncData
  • getOpacity(): number
  • getOpacity(): number
  • getRendererEffects(): Record<string, Filter>
  • getRendererEffects(): Record<string, Filter>
  • getRotationX(): number
  • getRotationX(): number
  • getRotationY(): number
  • getRotationY(): number
  • getScale(): number
  • getScale(): number
  • getScaleMean(): number
  • getScaleMean(): number
  • getScaleX(): number
  • getScaleX(): number
  • getScaleY(): number
  • getScaleY(): number
  • getScaleZ(): number
  • getScaleZ(): number
  • getSqDistanceToPosition(targetX: number, targetY: number): number

Returns number

  • getSqDistanceToPosition(targetX: number, targetY: number): number
  • getTimerElapsedTimeInSeconds(timerName: string): number

Returns number

  • getTimerElapsedTimeInSeconds(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
  • getUniqueId(): number
  • getUniqueId(): number
  • Get the unique identifier of the object.
    The identifier is set by the runtimeScene owning the object.
    You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

    Returns number

    The object identifier

    -
  • getUnrotatedAABBMaxZ(): number
  • getUnrotatedAABBMaxZ(): number
  • getUnrotatedAABBMinZ(): number
  • getUnrotatedAABBMinZ(): number
  • getUnscaledCenterX(): number
  • getUnscaledCenterY(): number
  • getUnscaledCenterZ(): number
  • getUnscaledDepth(): number
  • getUnscaledHeight(): number
  • getUnscaledWidth(): number
  • getVariableChildCount(variable: Variable): number
  • getUnscaledCenterX(): number
  • getUnscaledCenterY(): number
  • getUnscaledCenterZ(): number
  • getUnscaledDepth(): number
  • getUnscaledHeight(): number
  • getUnscaledWidth(): number
  • getVariableChildCount(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableNumber(variable: Variable): number
  • getVariableString(variable: Variable): string
  • getVariableString(variable: Variable): string
  • getVisibilityAABB(): null | AABB
  • getVisibilityAABB(): null | AABB
  • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

    The default implementation uses the AABB returned by getAABB.

    If null is returned, the object is assumed to be always visible.

    Returns null | AABB

    The bounding box or null.

    -
  • getWidth(): number
  • getWidth(): number
  • getX(): number
  • getX(): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • getXFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getY(): number

Returns number

  • getY(): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • getYFromAngleAndDistance(angle: number, distance: number): number
  • 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.

    Parameters

    • angle: number

      The angle, in degrees.

    • distance: number

      The distance from the object, in pixels

      -

    Returns number

  • getZ(): number

Returns number

  • getZ(): number
  • getZOrder(): number
  • getZOrder(): number
  • hasBehavior(name: string): boolean
  • hasBehavior(name: string): boolean
  • hasCustomRotationCenter(): boolean
  • hasEffect(name: string): boolean

Returns boolean

  • hasCustomRotationCenter(): boolean
  • hasEffect(name: string): boolean
  • hasNoForces(): boolean
  • hasNoForces(): boolean
  • hasVariable(name: string): boolean
  • hasVariable(name: string): boolean
  • hide(enable: boolean): void
  • hide(enable: boolean): void
  • insideObject(x: number, y: number): boolean

Returns void

  • insideObject(x: number, y: number): boolean
  • Return true if the specified position is inside object bounding box.

    The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

    -

    Parameters

    • x: number
    • y: number

    Returns boolean

  • invalidateHitboxes(): void
  • invalidateHitboxes(): void
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isCollidingWithPoint(pointX: number, pointY: number): boolean
  • isEffectEnabled(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isFlippedZ(): boolean
  • isHidden(): boolean
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isFlippedZ(): boolean
  • isHidden(): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isIncludedInParentCollisionMask(): boolean
  • isOnLayer(layer: string): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
  • Return true if the angle of the total force applied on the object is in a given range.

    Parameters

    • angle: number
      @@ -475,46 +475,46 @@

      The maximum distance from the given angle.

    Returns boolean

    true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

    -
  • isVisible(): boolean
  • isVisible(): boolean
  • Return true if the object is not hidden.

    Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

    Returns boolean

    true if the object is not hidden.

    -
  • notifyBehaviorsObjectHotReloaded(): void
  • notifyBehaviorsObjectHotReloaded(): void
  • onChildrenLocationChanged(): void
  • onCreated(): void
  • onChildrenLocationChanged(): void
  • onCreated(): void
  • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

    If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

    -

    Returns void

  • onDestroyed(): void
  • onDestroyed(): void

Returns void

  • pauseTimer(timerName: string): void

Returns void

  • pauseTimer(timerName: string): void
  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

Returns void

  • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
  • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

    Parameters

    • x: number
      @@ -525,7 +525,7 @@

      The distance between the object and the target, in pixels.

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

Returns void

  • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
  • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

    Parameters

    • obj: null | RuntimeObject
      @@ -534,7 +534,7 @@

      The distance between the object and the target

    • angleInDegrees: number

      The angle between the object and the target, in degrees.

      -

    Returns void

  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
  • registerDestroyCallback(callback: () => void): void
  • registerDestroyCallback(callback: () => void): void
  • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -560,7 +560,7 @@

  • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
-

Parameters

Returns void

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Returns boolean

Returns boolean

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns void

Returns boolean

Properties

angle: number = 0
forcesGarbage: Force[] = []
+

Returns void

Properties

angle: number = 0
forcesGarbage: Force[] = []

Global container for unused forces, avoiding recreating forces each tick.

-
static
getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

getFirstVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

Type declaration

    • Shortcut to get the first value of an array variable as a number.

      -

      Parameters

      Returns number

getFirstVariableString: (array: Variable) => string = ...

Type declaration

getFirstVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

Type declaration

    • Shortcut to get the first value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

getLastVariableNumber: (array: Variable) => number = ...

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

Type declaration

    • Shortcut to get the last value of an array variable as a number.

      -

      Parameters

      Returns number

getLastVariableString: (array: Variable) => string = ...

Type declaration

getLastVariableString: (array: Variable) => string = ...

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

Type declaration

    • Shortcut to get the last value of an array variable as a string.

      -

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • +

      Parameters

      Returns string

getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

Type declaration

    • (targetX: number, targetY: number): number
    • Get the squared distance, in pixels, between the center of this object and a position.

      Parameters

      • targetX: number

        Target X position

      • targetY: number

        Target Y position

        -

      Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns number

getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • +

      Parameters

      Returns boolean

getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

Type declaration

    • Get the number of children from a variable

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The number of children

      -
getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

Type declaration

    • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns number

      The value of the specified variable

      -
getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

Type declaration

    • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns string

      The string of the specified variable

      -
hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null
+
hidden: boolean = false
id: number
layer: string = ''
name: string
networkId: null | string = null

A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

-
persistentUuid: null | string = null
+
persistentUuid: null | string = null

An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

-
pick: boolean = false
+
pick: boolean = false

A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

-
returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

Type declaration

    • Return the variable passed as argument without any change. Only for usage by events.

      static

      Parameters

      • variable: Variable

        The variable to be accessed

      Returns Variable

      The specified variable

      -
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +
setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • +

    Returns void

setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

Type declaration

    • (variable: Variable, newValue: number): void
    • Shortcut to set the value of a variable considered as a number

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: number

        The value to be set

        -

      Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • +

    Returns void

setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

Type declaration

    • (variable: Variable, newValue: string): void
    • Shortcut to set the value of a variable considered as a string

      Parameters

      • variable: Variable

        The variable to be changed

      • newValue: string

        The value to be set

        -

      Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • +

    Returns void

supportsReinitialization: boolean = false
toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

type: string
valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable
        +

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

Type declaration

    • (variable: Variable, childName: string): boolean
    • static

      Parameters

      • variable: Variable

        The variable to be tested

      • childName: string

        The name of the child

        -

      Returns boolean

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

Type declaration

    • static

      Parameters

      • variable: Variable

        The variable to be cleared

        -

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

Type declaration

    • (variable: Variable, childName: string): void
    • static

      Parameters

      • variable: Variable

        The variable to be changed

      • childName: string

        The name of the child

        -

      Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • +

    Returns void

x: number = 0
y: number = 0
zOrder: number = 0
aabb: AABB = ...
hitBoxes: Polygon[]
hitBoxesDirty: boolean = true
getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

Type declaration

    • (variable: Variable, compareWith: boolean): boolean
    • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • +

      Parameters

      Returns boolean

setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

Type declaration

    • (variable: Variable, newValue: boolean): void
    • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

      Parameters

      Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • +

    Returns void

toggleVariableBoolean: (variable: Variable) => void = ...

Type declaration

    • Toggles a variable. This shortcut function is needed for events code generation.

      see

      {gdjs.evtTools.common.toggleVariableBoolean}

      -

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • +

      Parameters

      Returns void

valuePush: (array: Variable, value: string | number | boolean) => void = ...

Type declaration

    • (array: Variable, value: string | number | boolean): void
    • This shortcut function is needed for events code generation.

      -

      Parameters

      • array: Variable
      • value: string | number | boolean

      Returns void

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

variablePushCopy: (array: Variable, variable: Variable) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

variableRemoveAt: (array: Variable, index: number) => void = ...

Type declaration

    • This shortcut function is needed for events code generation.

      -

      Parameters

      Returns void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

The renderer for a gdjs.CustomRuntimeObject3D using Three.js.

-

Hierarchy

  • CustomRuntimeObject3DRenderer

Implements

Index

Constructors

Methods

  • ensureUpToDate(): void

Hierarchy

  • CustomRuntimeObject3DRenderer

Implements

Index

Constructors

Methods

  • ensureUpToDate(): void
  • get3DRendererObject(): Object3D<Object3DEventMap>
  • getAnimationFrameTextureManager(imageManager: PixiImageManager): ThreeAnimationFrameTextureManager
  • getRendererObject(): null
  • update(): void
  • updateAngle(): void
  • updateOpacity(): void
  • updatePosition(): void
  • updateRotation(): void
  • updateSize(): void
  • updateVisibility(): void
  • updateX(): void
  • updateY(): void

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

The instance container of a custom object, containing instances of objects rendered on screen.

see

gdjs.CustomRuntimeObject

-

Hierarchy

Index

Methods

  • addLayer(layerData: LayerData): void

Hierarchy

Index

Methods

  • addLayer(layerData: LayerData): void
  • convertCoords(x: number, y: number, result: FloatPoint): FloatPoint

Returns void

  • convertCoords(x: number, y: number, result: FloatPoint): FloatPoint
  • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint
  • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint
  • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, zPos: number, trackByPersistentUuid: boolean): void
  • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, zPos: number, trackByPersistentUuid: boolean): void
  • Create objects from initial instances data (for example, the initial instances of the scene or the instances of an external layout).

    Parameters

    • data: InstanceData[]
      @@ -30,100 +30,100 @@
    • trackByPersistentUuid: boolean

      If true, objects are tracked by setting their persistentUuid to the same as the associated instance. Useful for hot-reloading when instances are changed.

      -

    Returns void

  • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void

Returns void

  • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void
  • getAllLayerNames(result: string[]): void
  • getAllLayerNames(result: string[]): void

Returns void

  • getElapsedTime(): number
  • getElapsedTime(): number
  • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
  • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
  • getInstancesCountOnScene(objectName: string): number
  • getInstancesCountOnScene(objectName: string): number
  • getViewportHeight(): number
  • getViewportOriginX(): number
  • getViewportOriginY(): number
  • getViewportWidth(): number
  • hasLayer(name: string): boolean
  • getViewportHeight(): number
  • getViewportOriginX(): number
  • getViewportOriginY(): number
  • getViewportWidth(): number
  • hasLayer(name: string): boolean
  • isObjectRegistered(objectName: string): boolean

Returns boolean

  • isObjectRegistered(objectName: string): boolean

Returns void

  • onChildrenLocationChanged(): void

Returns void

  • onChildrenLocationChanged(): void
  • registerObject(objectData: ObjectData): void

Returns void

  • registerObject(objectData: ObjectData): void
  • removeLayer(layerName: string): void

Returns void

  • removeLayer(layerName: string): void
  • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void

Returns void

  • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void
  • setLayerIndex(layerName: string, newIndex: number): void

Returns void

  • setLayerIndex(layerName: string, newIndex: number): void
  • unregisterObject(objectName: string): void

Returns void

  • unregisterObject(objectName: string): void

Returns void

Returns boolean

true if the object was updated, false if it could not (i.e: hot-reload is not supported).

-
  • updateObject(objectData: ObjectData): void
  • updateObject(objectData: ObjectData): void
  • updateObjectsForces(): void

Returns void

  • updateObjectsForces(): void

Constructors

Constructors

Properties

pathfindingObstaclesManager: PathfindingObstaclesManager
tileMapCollisionMaskManager: TileMapRuntimeManager

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

A renderer for debug instances location of a container using Pixi.js.

see

gdjs.CustomRuntimeObject2DPixiRenderer

-

Hierarchy

  • DebuggerPixiRenderer

Index

Methods

  • clearDebugDraw(): void
  • getRendererObject(): null | Container<DisplayObject>
  • renderDebugDraw(instances: RuntimeObject[], showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void

Hierarchy

  • DebuggerPixiRenderer

Index

Methods

  • clearDebugDraw(): void
  • getRendererObject(): null | Container<DisplayObject>
  • renderDebugDraw(instances: RuntimeObject[], showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void
  • Render graphics for debugging purpose. Activate this in gdjs.RuntimeScene, in the renderAndStep method.

    see

    gdjs.RuntimeInstanceContainer#enableDebugDraw

    -

    Parameters

    • instances: RuntimeObject[]
    • showHiddenInstances: boolean
    • showPointsNames: boolean
    • showCustomPoints: boolean

    Returns void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

The DestroyOutsideRuntimeBehavior represents a behavior that destroys the object when it leaves the screen.

-

Hierarchy

Index

Methods

  • activate(enable: boolean): void

Hierarchy

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean

Returns void

  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • getExtraBorder(): number

Returns void

  • enableSynchronization(enable: boolean): void
  • getExtraBorder(): number
  • getName(): string
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void
  • setExtraBorder(val: number): void
  • setExtraBorder(val: number): void

Returns void

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    -

    Returns boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

The DraggableRuntimeBehavior represents a behavior allowing objects to be moved using the mouse.

-

Hierarchy

Index

Methods

  • activate(enable: boolean): void

Hierarchy

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean

Returns void

  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isDragged(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isDragged(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • onObjectHotReloaded(): void
  • onObjectHotReloaded(): void

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    -

    Returns boolean

  • wasJustDropped(): boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    -

    Returns boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

A behavior that forwards the EffectBehavior interface to its object.

-

Hierarchy

Implements

Index

Methods

  • activate(enable: boolean): void

Hierarchy

Implements

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean

Returns void

  • activated(): boolean
  • enableEffect(name: string, enable: boolean): void
  • enableEffect(name: string, enable: boolean): void
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • enableSynchronization(enable: boolean): void
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isEffectEnabled(name: string): boolean
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isEffectEnabled(name: string): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void
  • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
  • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
  • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
  • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
  • setEffectStringParameter(name: string, parameterName: string, value: string): boolean
  • setEffectStringParameter(name: string, parameterName: string, value: string): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean
  • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

    -

    Returns boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

A behavior that forwards the Flippable interface to its object.

-

Hierarchy

Implements

Index

Methods

  • activate(enable: boolean): void

Hierarchy

Implements

Index

Methods

  • activate(enable: boolean): void
  • activated(): boolean

Returns void

  • activated(): boolean
  • enableSynchronization(enable: boolean): void
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • getName(): string
  • enableSynchronization(enable: boolean): void
  • flipX(enable: boolean): void
  • flipY(enable: boolean): void
  • getName(): string
  • getNameId(): number
  • getNameId(): number
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • getNetworkSyncData(): BehaviorNetworkSyncData
  • isFlippedX(): boolean
  • isFlippedY(): boolean
  • isSyncedOverNetwork(): boolean
  • onActivate(): void
  • onCreated(): void
  • onCreated(): void
  • onDeActivate(): void
  • onDeActivate(): void
  • onDestroy(): void
  • onDestroy(): void
  • 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(): void
  • onObjectHotReloaded(): void

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

Returns void

  • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
  • usesLifecycleFunction(): boolean

Returns void

  • usesLifecycleFunction(): boolean

Constructors

Properties

name: string
type: string

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

A vector used to move objects.

-

Hierarchy

  • Force

Index

Methods

  • add(x: number, y: number): void
  • addForce(force: Force): void
  • clear(): void
  • getAngle(): number

Hierarchy

  • Force

Index

Methods

  • add(x: number, y: number): void
  • addForce(force: Force): void
  • clear(): void
  • getAngle(): number
  • getLength(): number
  • getLength(): number
  • getMultiplier(): number
  • getMultiplier(): number
  • getNetworkSyncData(): ForceNetworkSyncData
  • getX(): number
  • getNetworkSyncData(): ForceNetworkSyncData
  • getX(): number
  • getY(): number
  • getY(): number
  • setAngle(angle: number): void
  • setAngle(angle: number): void
  • setLength(len: number): void

Returns void

  • setLength(len: number): void
  • setMultiplier(multiplier: number): void

Returns void

  • setMultiplier(multiplier: number): void
  • setX(x: number): void

Returns void

  • setX(x: number): void
  • Set the x component of the force.

    Parameters

    • x: number

      The new X component

      -

    Returns void

  • setY(y: number): void

Returns void

  • setY(y: number): void
  • Set the y component of the force.

    Parameters

    • y: number

      The new Y component

      -

    Returns void

  • updateFromNetworkSyncData(syncData: ForceNetworkSyncData): void

Constructors

  • new Force(x: number, y: number, multiplier: number): Force
  • updateFromNetworkSyncData(syncData: ForceNetworkSyncData): void

Constructors

  • new Force(x: number, y: number, multiplier: number): Force

Methods

  • deepEqual(a: any, b: any): boolean
  • groupByPersistentUuid<ObjectWithPersistentId>(objectsWithPersistentId: ObjectWithPersistentId[]): Record<string, ObjectWithPersistentId>
  • Type parameters

    • ObjectWithPersistentId: { persistentUuid: null | string }

    Parameters

    • objectsWithPersistentId: ObjectWithPersistentId[]

    Returns Record<string, ObjectWithPersistentId>

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Displays uncaught exceptions on top of the game. Could be reworked in the future to support a minimal debugger inside the game.

-

Hierarchy

  • InGameDebugger

Index

Constructors

Methods

  • render(): void
  • setUncaughtException(exception: null | Error): void

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Store input made on a canvas: mouse position, key pressed and touches states.

-

Hierarchy

  • InputManager

Index

Properties

MOUSE_BACK_BUTTON: number = 3
MOUSE_FORWARD_BUTTON: number = 4
MOUSE_LEFT_BUTTON: number = 0
MOUSE_MIDDLE_BUTTON: number = 2
MOUSE_RIGHT_BUTTON: number = 1
MOUSE_TOUCH_ID: number = 1

Methods

  • anyKeyPressed(): boolean

Hierarchy

  • InputManager

Index

Properties

MOUSE_BACK_BUTTON: number = 3
MOUSE_FORWARD_BUTTON: number = 4
MOUSE_LEFT_BUTTON: number = 0
MOUSE_MIDDLE_BUTTON: number = 2
MOUSE_RIGHT_BUTTON: number = 1
MOUSE_TOUCH_ID: number = 1

Methods

  • anyKeyPressed(): boolean
  • anyKeyReleased(): boolean
  • anyKeyReleased(): boolean
  • getAllTouchIdentifiers(): number[]
  • getAllTouchIdentifiers(): number[]
  • getCursorX(): number
  • getCursorX(): number
  • Get the cursor X position. The cursor is moved by mouse and touch events.

    Returns number

    the cursor X position, relative to the game view.

    -
  • getCursorY(): number
  • getCursorY(): number
  • Get the cursor Y position. The cursor is moved by mouse and touch events.

    Returns number

    the cursor Y position, relative to the game view.

    -
  • getLastPressedKey(): number
  • getLastPressedKey(): number
  • Return the location-aware code of the last key that was pressed.

    Returns number

    The location-aware code of the last key pressed.

    -
  • getMouseWheelDelta(): number
  • getMouseWheelDelta(): number
  • getMouseX(): number
  • getMouseX(): number
  • getMouseY(): number
  • getMouseY(): number
  • getStartedTouchIdentifiers(): number[]
  • getTouchX(publicIdentifier: number): number
  • getStartedTouchIdentifiers(): number[]
  • getTouchX(publicIdentifier: number): number
  • Get a touch X position.

    Parameters

    • publicIdentifier: number

    Returns number

    the touch X position, relative to the game view.

    -
  • getTouchY(publicIdentifier: number): number
  • getTouchY(publicIdentifier: number): number
  • Get a touch Y position.

    Parameters

    • publicIdentifier: number

    Returns number

    the touch Y position, relative to the game view.

    -
  • hasTouchEnded(publicIdentifier: number): boolean
  • hasTouchEnded(publicIdentifier: number): boolean
  • isKeyPressed(locationAwareKeyCode: number): boolean
  • isKeyPressed(locationAwareKeyCode: number): boolean
  • Return true if the key corresponding to the location-aware keyCode is pressed.

    Parameters

    • locationAwareKeyCode: number

      The location-aware key code to be tested.

      -

    Returns boolean

  • isMouseButtonPressed(buttonCode: number): boolean

Returns boolean

  • isMouseButtonPressed(buttonCode: number): boolean
  • Return true if the mouse button corresponding to buttonCode is pressed.

    Parameters

    • buttonCode: number

      The mouse button code (0: Left button, 1: Right button).

      -

    Returns boolean

  • isMouseButtonReleased(buttonCode: number): boolean

Returns boolean

  • isMouseButtonReleased(buttonCode: number): boolean
  • Return true if the mouse button corresponding to buttonCode was just released.

    Parameters

    • buttonCode: number

      The mouse button code (0: Left button, 1: Right button).

      -

    Returns boolean

  • isMouseInsideCanvas(): boolean
  • isScrollingDown(): boolean

Returns boolean

  • isMouseInsideCanvas(): boolean
  • isScrollingDown(): boolean
  • isScrollingUp(): boolean
  • isScrollingUp(): boolean
  • isSimulatingMouseWithTouch(): boolean
  • onFrameEnded(): void
  • isSimulatingMouseWithTouch(): boolean
  • onFrameEnded(): void
  • Notify the input manager that the frame ended, so anything that last only for one frame (started/ended touches) should be reset.

    This method should be called in the game loop (see gdjs.RuntimeGame.startGameLoop). You don't need to call it otherwise.

    -

    Returns void

  • onKeyPressed(keyCode: number, location?: number): void
  • onKeyPressed(keyCode: number, location?: number): void
  • Should be called whenever a key is pressed. The location corresponds to KeyboardEvent.location, which should be 0 for standard keys, 1 for left keys, 2 for right keys, and 3 for numpad keys.

    @@ -68,7 +68,7 @@

    The raw key code associated to the key press.

  • Optional location: number

    The location of the event.

    -

Returns void

  • onKeyReleased(keyCode: number, location?: number): void

Returns void

  • onKeyReleased(keyCode: number, location?: number): void
  • Should be called whenever a key is released. The location corresponds to KeyboardEvent.location, which should be 0 for standard keys, 1 for left keys, 2 for right keys, and 3 for numpad keys.

    @@ -76,47 +76,47 @@

    The raw key code associated to the key release.

  • Optional location: number

    The location of the event.

    -

Returns void

  • onMouseButtonPressed(buttonCode: number): void

Returns void

  • onMouseButtonPressed(buttonCode: number): void
  • Should be called whenever a mouse button is pressed.

    Parameters

    • buttonCode: number

      The mouse button code associated to the event. See InputManager.MOUSE_LEFT_BUTTON, InputManager.MOUSE_RIGHT_BUTTON, InputManager.MOUSE_MIDDLE_BUTTON

      -

    Returns void

  • onMouseButtonReleased(buttonCode: number): void

Returns void

  • onMouseButtonReleased(buttonCode: number): void
  • Should be called whenever a mouse button is released.

    Parameters

    • buttonCode: number

      The mouse button code associated to the event. (see onMouseButtonPressed)

      -

    Returns void

  • onMouseEnter(): void

Returns void

  • onMouseEnter(): void
  • onMouseLeave(): void
  • onMouseLeave(): void
  • onMouseMove(x: number, y: number): void
  • onMouseMove(x: number, y: number): void
  • Should be called when the mouse is moved.

    Please note that the coordinates must be expressed relative to the view position.

    Parameters

    • x: number

      The mouse new X position

    • y: number

      The mouse new Y position

      -

    Returns void

  • onMouseWheel(wheelDelta: number): void

Returns void

  • onMouseWheel(wheelDelta: number): void
  • onTouchCancel(rawIdentifier: number): void
  • onTouchEnd(rawIdentifier: number): void
  • onTouchMove(rawIdentifier: number, x: number, y: number): void
  • onTouchStart(rawIdentifier: number, x: number, y: number): void
  • popEndedTouch(): undefined | number
  • popStartedTouch(): undefined | number
  • touchSimulateMouse(enable: boolean): void

Returns void

  • onTouchCancel(rawIdentifier: number): void
  • onTouchEnd(rawIdentifier: number): void
  • onTouchMove(rawIdentifier: number, x: number, y: number): void
  • onTouchStart(rawIdentifier: number, x: number, y: number): void
  • popEndedTouch(): undefined | number
  • popStartedTouch(): undefined | number
  • touchSimulateMouse(enable: boolean): void
  • Set if touch events should simulate mouse events.

    If true, any touch will move the mouse position and set mouse buttons as pressed/released.

    Parameters

    • enable: boolean

      true to simulate mouse events, false to disable it.

      -

    Returns void

  • wasKeyReleased(locationAwareKeyCode: number): boolean

Returns void

  • wasKeyReleased(locationAwareKeyCode: number): boolean
  • Return true if the key corresponding to the location-aware keyCode was released during the last frame.

    Parameters

    • locationAwareKeyCode: number

      The location-aware key code to be tested.

      -

    Returns boolean

  • getPublicTouchIdentifier(rawIdentifier: number): number

Returns boolean

  • getPublicTouchIdentifier(rawIdentifier: number): number
  • Add 2 to the identifier to avoid identifiers taking the GDevelop default variable value which is 0 and reserve 1 for the mouse.

    Parameters

    • rawIdentifier: number

      The identifier given by the browser.

    Returns number

    The identifier used in events.

    -

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Inventory

Index

Methods

  • add(itemName: any): boolean
  • clear(): void
  • count(itemName: any): any
  • equip(itemName: any, equip: any): boolean
  • getAllItems(): any
  • has(itemName: any): boolean
  • isEquipped(itemName: any): boolean
  • isFull(itemName: any): boolean
  • maximum(itemName: any): any
  • remove(itemName: any): boolean
  • setCount(itemName: any, count: any): void
  • setMaximum(itemName: any, maxCount: any): void
  • setUnlimited(itemName: any, enable: any): void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Inventory

Index

Methods

  • add(itemName: any): boolean
  • clear(): void
  • count(itemName: any): any
  • equip(itemName: any, equip: any): boolean
  • getAllItems(): any
  • has(itemName: any): boolean
  • isEquipped(itemName: any): boolean
  • isFull(itemName: any): boolean
  • maximum(itemName: any): any
  • remove(itemName: any): boolean
  • setCount(itemName: any, count: any): void
  • setMaximum(itemName: any, maxCount: any): void
  • setUnlimited(itemName: any, enable: any): void

Constructors

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Generated using TypeDoc

Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a layer of a scene, used to display objects.

-

Hierarchy

Index

Methods

  • addEffect(effectData: EffectData): void

Hierarchy

Index

Methods

  • addEffect(effectData: EffectData): void
  • applyLayerInverseTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint

Returns void

  • applyLayerInverseTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
  • Return an array containing the coordinates of the point passed as parameter in layer local coordinates (as opposed to the parent coordinates).

    All transformations (scale, rotation) are supported.

    @@ -15,7 +15,7 @@

    The Y position of the point, in parent coordinates.

  • cameraId: number
  • result: FloatPoint

    Array that will be updated with the result

    -

Returns FloatPoint

  • applyLayerTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint

Returns FloatPoint

  • applyLayerTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
  • Return an array containing the coordinates of the point passed as parameter in parent coordinate coordinates (as opposed to the layer local coordinates).

    All transformations (scale, rotation) are supported.

    @@ -27,7 +27,7 @@
  • cameraId: number
  • result: FloatPoint

    Array that will be updated with the result (x and y position of the point in parent coordinates).

    -

Returns FloatPoint

  • convertCoords(x: number, y: number, cameraId?: number, result: FloatPoint): FloatPoint

Returns FloatPoint

  • convertCoords(x: number, y: number, cameraId?: number, result: FloatPoint): FloatPoint
  • Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.

    This method handles 3D rotations.

    @@ -39,7 +39,7 @@

    The camera number. Currently ignored.

  • result: FloatPoint

    The point instance that is used to return the result.

    -

Returns FloatPoint

  • convertInverseCoords(x: number, y: number, cameraId?: number, result: FloatPoint): FloatPoint

Returns FloatPoint

  • convertInverseCoords(x: number, y: number, cameraId?: number, result: FloatPoint): FloatPoint
  • Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.

    This method doesn't handle 3D rotations.

    @@ -51,122 +51,122 @@

    The camera number. Currently ignored.

  • result: FloatPoint

    The point instance that is used to return the result.

    -

Returns FloatPoint

  • enableEffect(name: string, enable: boolean): void

Returns FloatPoint

  • enableEffect(name: string, enable: boolean): void
  • followBaseLayer(): void

Returns void

  • followBaseLayer(): void
  • get3DRendererObject(): null | Scene
  • getCameraHeight(cameraId?: number): number
  • get3DRendererObject(): null | Scene
  • getCameraHeight(cameraId?: number): number
  • Get the camera height (which can be different than the game resolution height if the camera is zoomed).

    Parameters

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns number

    The height of the camera

    -
  • getCameraRotation(cameraId?: number): number
  • getCameraRotation(cameraId?: number): number
  • getCameraWidth(cameraId?: number): number
  • getCameraWidth(cameraId?: number): number
  • Get the camera width (which can be different than the game resolution width if the camera is zoomed).

    Parameters

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns number

    The width of the camera

    -
  • getCameraX(cameraId?: number): number
  • getCameraX(cameraId?: number): number
  • getCameraY(cameraId?: number): number
  • getCameraY(cameraId?: number): number
  • getCameraZ(fov: null | number, cameraId?: number): number
  • getCameraZ(fov: null | number, cameraId?: number): number
  • Get the camera center Z position.

    Parameters

    • fov: null | number

      The field of view.

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns number

    The z position of the camera

    -
  • getCameraZoom(cameraId?: number): number
  • getCameraZoom(cameraId?: number): number
  • getClearColor(): number[]
  • getClearColor(): number[]
  • getDefaultZOrder(): number
  • getDefaultZOrder(): number
  • getHeight(): number
  • getInitialCamera3DFarPlaneDistance(): number
  • getInitialCamera3DFieldOfView(): number
  • getInitialCamera3DNearPlaneDistance(): number
  • getInitialEffectsData(): EffectData[]

Returns number

  • getHeight(): number
  • getInitialCamera3DFarPlaneDistance(): number
  • getInitialCamera3DFieldOfView(): number
  • getInitialCamera3DNearPlaneDistance(): number
  • getInitialEffectsData(): EffectData[]
  • getName(): string
  • getName(): string
  • getRendererEffects(): Record<string, Filter>
  • getRendererEffects(): Record<string, Filter>
  • getRendererObject(): Container<DisplayObject>
  • getRendererObject(): Container<DisplayObject>
  • getTimeScale(): number
  • getTimeScale(): number
  • getWidth(): number
  • hasEffect(name: string): boolean
  • getWidth(): number
  • hasEffect(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isLightingLayer(): boolean
  • isLightingLayer(): boolean
  • isVisible(): boolean
  • isVisible(): boolean
  • onGameResolutionResized(oldGameResolutionOriginX: number, oldGameResolutionOriginY: number): void
  • onGameResolutionResized(oldGameResolutionOriginX: number, oldGameResolutionOriginY: number): void
  • removeEffect(effectName: string): void
  • removeEffect(effectName: string): void
  • setCameraRotation(rotation: number, cameraId?: number): void

Returns void

  • setCameraRotation(rotation: number, cameraId?: number): void
  • Set the rotation of the camera, expressed in degrees. The rotation is made around the camera center.

    Parameters

    • rotation: number

      The new rotation, in degrees.

    • Optional cameraId: number

      The camera number. Currently ignored.

      -

    Returns void

  • setCameraX(x: number, cameraId?: number): void

Returns void

  • setCameraX(x: number, cameraId?: number): void
  • setCameraY(y: number, cameraId?: number): void

Returns void

  • setCameraY(y: number, cameraId?: number): void
  • setCameraZ(z: number, fov: null | number, cameraId?: number): void

Returns void

  • setCameraZ(z: number, fov: null | number, cameraId?: number): void
  • Set the camera center Z position.

    Parameters

    • z: number

      The new y position.

      @@ -174,13 +174,13 @@

      The field of view.

    • Optional cameraId: number

      The camera number. Currently ignored.

      -

    Returns void

  • setCameraZoom(newZoom: number, cameraId?: number): void

Returns void

  • setCameraZoom(newZoom: number, cameraId?: number): void
  • Set the zoom of a camera.

    Parameters

    • newZoom: number

      The new zoom. Must be superior to 0. 1 is the default zoom.

    • Optional cameraId: number

      The camera number. Currently ignored.

      -

    Returns void

  • setClearColor(r: number, g: number, b: number): void

Returns void

  • setClearColor(r: number, g: number, b: number): void
  • Set the clear color in format [r, g, b], with components in the range of 0 to 1.;

    Parameters

    • r: number

      Red color component in the range 0-255.

      @@ -188,11 +188,11 @@

      Green color component in the range 0-255.

    • b: number

      Blue color component in the range 0-255.

      -

    Returns void

  • setDefaultZOrder(defaultZOrder: number): void

Returns void

  • setDefaultZOrder(defaultZOrder: number): void
  • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): void

Returns void

  • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): void
  • setEffectDoubleParameter(name: string, parameterName: string, value: number): void

Returns void

  • setEffectDoubleParameter(name: string, parameterName: string, value: number): void
  • setEffectStringParameter(name: string, parameterName: string, value: string): void

Returns void

  • setEffectStringParameter(name: string, parameterName: string, value: string): void
  • setFollowBaseLayerCamera(follow: boolean): void

Returns void

  • setFollowBaseLayerCamera(follow: boolean): void
  • setTimeScale(timeScale: number): void
  • setTimeScale(timeScale: number): void
  • show(enable: boolean): void

Returns void

  • show(enable: boolean): void

Returns void

Constructors

Constructors

  • changeRendererObjectZOrder(pixiChild: any, newZOrder: number): void
  • getLightingSprite(): null | Sprite

Returns void

  • getLightingSprite(): null | Sprite
  • getRendererObject(): Container<DisplayObject>
  • getThreeCamera(): null | PerspectiveCamera | OrthographicCamera
  • getThreeEffectComposer(): null | EffectComposer
  • getThreeScene(): null | Scene
  • has2DObjects(): boolean
  • has3DObjects(): boolean
  • hasPostProcessingPass(): boolean
  • isCameraRotatedIn3D(): null | boolean
  • onCreated(): void
  • onGameResolutionResized(): void
  • remove3DRendererObject(object: Object3D<Object3DEventMap>): void
  • removePostProcessingPass(pass: Pass): void
  • removeRendererObject(child: any): void
  • getRendererObject(): Container<DisplayObject>
  • getThreeCamera(): null | PerspectiveCamera | OrthographicCamera
  • getThreeEffectComposer(): null | EffectComposer
  • getThreeScene(): null | Scene
  • has2DObjects(): boolean
  • has3DObjects(): boolean
  • hasPostProcessingPass(): boolean
  • isCameraRotatedIn3D(): null | boolean
  • onCreated(): void
  • onGameResolutionResized(): void
  • remove3DRendererObject(object: Object3D<Object3DEventMap>): void
  • removePostProcessingPass(pass: Pass): void
  • removeRendererObject(child: any): void
  • renderOnPixiRenderTexture(pixiRenderer: Renderer): void

Returns void

  • renderOnPixiRenderTexture(pixiRenderer: Renderer): void
  • Render the layer of the PixiJS RenderTexture, so that it can be then displayed with a blend mode (for a lighting layer) or consumed by Three.js (for 2D+3D layers).

    -

    Parameters

    • pixiRenderer: Renderer

    Returns void

  • setThreeCameraDirty(enable: boolean): void
  • show2DRenderingPlane(enable: boolean): void
  • transformTo3DWorld(screenX: number, screenY: number, worldZ: number, cameraId: number, result: FloatPoint): FloatPoint
  • updateClearColor(): void
  • updatePosition(): void
  • setThreeCameraDirty(enable: boolean): void
  • show2DRenderingPlane(enable: boolean): void
  • transformTo3DWorld(screenX: number, screenY: number, worldZ: number, cameraId: number, result: FloatPoint): FloatPoint
  • updateClearColor(): void
  • updatePosition(): void
  • updatePreRender(): void
  • updateResolution(): void
  • updateThreePlaneTextureFromPixiRenderTexture(threeRenderer: WebGLRenderer, pixiRenderer: Renderer): void
  • updatePreRender(): void
  • updateResolution(): void
  • updateThreePlaneTextureFromPixiRenderTexture(threeRenderer: WebGLRenderer, pixiRenderer: Renderer): void
  • Set the texture of the 2D plane in the 3D world to be the same WebGL texture as the PixiJS RenderTexture - so that the 2D rendering can be shown in the 3D world.

    -

    Parameters

    • threeRenderer: WebGLRenderer
    • pixiRenderer: Renderer

    Returns void

  • updateVisibility(visible: boolean): void

Constructors

  • updateVisibility(visible: boolean): void

Constructors

Properties

vectorForProjections: null | Vector3 = null
zeroZOrderForPixi: number = ...
+
  • runtimeGameRenderer: RuntimeGamePixiRenderer
  • Returns LayerPixiRenderer

    Properties

    vectorForProjections: null | Vector3 = null
    zeroZOrderForPixi: number = ...

    Pixi doesn't sort children with zIndex == 0.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • enableSynchronization(enable: boolean): void
    • getName(): string
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean
  • newBehaviorData: BehaviorData

    The new data for the behavior.

  • Returns boolean

    true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

    -
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    currentRBushAABB: null | BehaviorRBushAABB<LightObstacleRuntimeBehavior> = null
    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • LightObstaclesManager

    Index

    Methods

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Displays a Light object.

    -

    Hierarchy

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,70 +78,70 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>

    Returns void

    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -149,59 +149,59 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getColor(): string
    • getColor(): string
    • getDebugMode(): boolean
    • getDebugMode(): boolean
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • getDrawableY(): number
    • getDrawableY(): number
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -226,176 +226,176 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getRadius(): number
    • getRadius(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): null | Container<DisplayObject> | Mesh<MeshMaterial>
    • getRendererObject(): null | Container<DisplayObject> | Mesh<MeshMaterial>
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTexture(): string

    Returns number

    • getTexture(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hexToRGBColor(hex: any): number[]
    • hide(enable: boolean): void
    • hexToRGBColor(hex: any): number[]
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isHidden(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -404,43 +404,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -451,7 +451,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -460,7 +460,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -486,7 +486,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Pixi renderer for light runtime objects.

    -

    Hierarchy

    • LightRuntimeObjectPixiRenderer

    Index

    Constructors

    Properties

    defaultFragmentShader: string = ...
    defaultVertexShader: string = ...
    texturedFragmentShader: string = ...

    Methods

    • ensureUpToDate(): void
    • getRendererObject(): null | Container<DisplayObject> | Mesh<MeshMaterial>
    • updateColor(): void
    • updateDebugMode(): void
    • updateMesh(): void
    • updateRadius(): void
    • updateTexture(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Manages the links between objects.

    -

    Hierarchy

    • LinksManager

    Index

    Constructors

    Methods

    Hierarchy

    • LinksManager

    Index

    Constructors

    Methods

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A Console API like class for logging in a GDevelop game.

    -

    Hierarchy

    • Logger

    Index

    Constructors

    • new Logger(group: string): Logger

    Hierarchy

    • Logger

    Index

    Constructors

    • new Logger(group: string): Logger
    • Create a new logger with the given group name. You can then use log, info, warn and error on this object.

      -

      Parameters

      • group: string

      Returns Logger

    Methods

    • error(...messages: any[]): void
    • getDefaultConsoleLoggerOutput(): ConsoleLoggerOutput

    Methods

    • error(...messages: any[]): void
    • getDefaultConsoleLoggerOutput(): ConsoleLoggerOutput
    • Give access to the console output used by default by the logger. This can be useful to restore the default log method if you overrode it or to disable some logging in the console.

      -

      Returns ConsoleLoggerOutput

    • info(...messages: any[]): void
    • log(...messages: any[]): void
    • info(...messages: any[]): void
    • log(...messages: any[]): void
    • warn(...messages: any[]): void

    Properties

    group: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A container for objects lists that should last more than the current frame. It automatically removes objects that were destroyed from the objects lists.

    -

    Hierarchy

    • LongLivedObjectsList

    Index

    Methods

    • addObject(objectName: string, runtimeObject: RuntimeObject): void

    Hierarchy

    • LongLivedObjectsList

    Index

    Methods

    • addObject(objectName: string, runtimeObject: RuntimeObject): void
    • Create a new container for objects lists, inheriting from another one. This is useful should we get the objects that have not been saved in this context (using addObject) but saved in a parent context. This avoids to save all object lists every time we create a new LongLivedObjectsList, despite not all objects lists being used.

      -

      Parameters

      Returns LongLivedObjectsList

    • removeObject(objectName: string, runtimeObject: RuntimeObject): void

    Constructors

    Properties

    callbacks: Map<RuntimeObject, () => void> = ...
    localVariablesContainers: VariablesContainer[] = []
    objectsLists: Map<string, RuntimeObject[]> = ...
    parent: null | LongLivedObjectsList = null

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Methods

    Properties

    Constructors

    Methods

    • resolve(): void
    • update(): boolean
    • +ManuallyResolvableTask | GDevelop JavaScript game engine
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Legend

      • Method
      • Inherited constructor
      • Private property

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Load GLB files (using Three.js), using the "model3D" resources registered in the game resources.

      -

      Hierarchy

      • Model3DManager

      Implements

      Index

      Constructors

      Hierarchy

      • Model3DManager

      Implements

      Index

      Constructors

      Methods

      • getModel(resourceName: string): GLTF

      Returns Model3DManager

    Methods

    • getModel(resourceName: string): GLTF
    • Return a 3D model.

      Caller should not modify the object but clone it.

      Parameters

      • resourceName: string

        The name of the json resource.

      Returns GLTF

      a 3D model if it exists.

      -
    • getResourceKinds(): ResourceKind[]
    • getResourceKinds(): ResourceKind[]
    • loadResource(resourceName: string): Promise<void>
    • loadResource(resourceName: string): Promise<void>
    • processResource(resourceName: string): Promise<void>
    • processResource(resourceName: string): Promise<void>
    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,76 +78,76 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • flipZ(enable: boolean): void
    • get3DRendererObject(): Object3D<Object3DEventMap>
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • flipZ(enable: boolean): void
    • get3DRendererObject(): Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number
    • getAnimationDuration(): number
    • getAnimationElapsedTime(): number
    • getAnimationIndex(): number

    Returns number

    • getAnimationDuration(): number
    • getAnimationElapsedTime(): number
    • getAnimationIndex(): number
    • getAnimationName(): string
    • getAnimationName(): string
    • getAnimationSpeedScale(): number
    • getAnimationSpeedScale(): number
    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -155,75 +155,75 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getCenterZ(): number
    • getCenterZ(): number
    • Return the Z position of the object center, relative to the object Z position (getDrawableX).

      Use getCenterZInScene to get the position of the center in the scene.

      Returns number

      the Z position of the object center, relative to getDrawableZ().

      -
    • getCenterZInScene(): number
    • getCenterZInScene(): number
    • getDepth(): number
    • getDepth(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getDrawableZ(): number
    • getDrawableZ(): number
    • Get the Z position of the rendered object.

      For most objects, this will returns the same value as getZ(). But if the object has an origin that is not the same as the point (0,0,0) of the object displayed, getDrawableZ will differ.

      Returns number

      The Z position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -248,142 +248,142 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getNetworkSyncData(): Model3DObjectNetworkSyncData
    • getNetworkSyncData(): Model3DObjectNetworkSyncData
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): null
    • getRotationX(): number
    • getRendererObject(): null
    • getRotationX(): number
    • getRotationY(): number
    • getRotationY(): number
    • getScale(): number
    • getScale(): number
    • Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).

      Returns number

      the scale of the object (or the geometric average of X, Y and Z scale in case they are different).

      -
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getScaleZ(): number
    • getScaleZ(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getUnrotatedAABBMaxZ(): number
    • getUnrotatedAABBMaxZ(): number
    • getUnrotatedAABBMinZ(): number
    • getUnrotatedAABBMinZ(): number
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZ(): number

    Returns number

    • getZ(): number
    • getZOrder(): number
    • getZOrder(): number
    • hasAnimationEnded(): boolean
    • hasAnimationEnded(): boolean
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean
    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isAnimationPaused(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isAnimationPaused(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCurrentAnimationName(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isCurrentAnimationName(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isFlippedZ(): boolean
    • isHidden(): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isFlippedZ(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -449,43 +449,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseAnimation(): void
    • pauseTimer(timerName: string): void

    Returns void

    • pauseAnimation(): void
    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -496,7 +496,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -505,7 +505,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -531,7 +531,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The MultiplayerObjectRuntimeBehavior represents a behavior that can be added to objects to make them synchronized over the network.

    -

    Hierarchy

    Index

    Properties

    actionOnPlayerDisconnect: string
    name: string
    playerNumber: number = 0
    type: string

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Index

    Properties

    actionOnPlayerDisconnect: string
    name: string
    playerNumber: number = 0
    type: string

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • doStepPostEvents(): void
    • doStepPostEvents(): void
    • enableBehaviorSynchronization(behaviorName: string, enable: boolean): void
    • enableSynchronization(enable: boolean): void
    • getActionOnPlayerDisconnect(): string
    • getName(): string

    Returns void

    • enableBehaviorSynchronization(behaviorName: string, enable: boolean): void
    • enableSynchronization(enable: boolean): void
    • getActionOnPlayerDisconnect(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getPlayerObjectOwnership(): number
    • isObjectOwnedByCurrentPlayer(): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getPlayerObjectOwnership(): number
    • isObjectOwnedByCurrentPlayer(): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • onObjectHotReloaded(): void
    • onObjectHotReloaded(): void
    • removeObjectOwnership(): void
    • setPlayerObjectOwnership(newObjectPlayerNumber: number): void
    • removeObjectOwnership(): void
    • setPlayerObjectOwnership(newObjectPlayerNumber: number): void

    Returns void

    • takeObjectOwnership(): void
    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean

    Returns void

    • takeObjectOwnership(): void
    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean
  • newBehaviorData: BehaviorData

    The new data for the behavior.

  • Returns boolean

    true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

    -
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    OnceTriggers is used to store the status of the conditions "Trigger once", that are used in events to have conditions that are only valid for one frame in a row.

    -

    Hierarchy

    • OnceTriggers

    Index

    Constructors

    Methods

    • startNewFrame(): void

    Hierarchy

    • OnceTriggers

    Index

    Constructors

    Methods

    • startNewFrame(): void
    • triggerOnce(triggerId: number): boolean
    • triggerOnce(triggerId: number): boolean
    • activated(): boolean
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getOpacity(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getOpacity(): number
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • setOpacity(opacity: number): void
    • setOpacity(opacity: number): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The PanelSpriteRuntimeObject displays a tiled texture.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,67 +78,67 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -146,62 +146,62 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getColor(): string
    • getColor(): string
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -226,177 +226,177 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Container<DisplayObject>
    • getRendererObject(): Container<DisplayObject>
    • getScale(): number
    • getScale(): number
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isHidden(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -405,43 +405,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -452,7 +452,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -461,7 +461,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -487,7 +487,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    opacity: number = 255
    persistentUuid: null | string = null
    +
    opacity: number = 255
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,70 +78,70 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>

    Returns void

    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAdditiveRendering(): boolean
    • getAngle(): number
    • getAdditiveRendering(): boolean
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -149,61 +149,61 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getConeSprayAngle(): number
    • getConeSprayAngle(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getEmitterAngle(): number
    • getEmitterAngleA(): number
    • getEmitterAngleB(): number
    • getEmitterForceMax(): number
    • getEmitterForceMin(): number
    • getFlow(): number
    • getHeight(): number

    Returns number

    • getEmitterAngle(): number
    • getEmitterAngleA(): number
    • getEmitterAngleB(): number
    • getEmitterForceMax(): number
    • getEmitterForceMin(): number
    • getFlow(): number
    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -228,167 +228,167 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getMaxParticlesCount(): number
    • getName(): string
    • getMaxParticlesCount(): number
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getParticleAlpha1(): number
    • getParticleAlpha2(): number
    • getParticleBlue1(): number
    • getParticleBlue2(): number
    • getParticleCount(): number
    • getParticleGravityAngle(): number
    • getParticleGravityLength(): number
    • getParticleGravityX(): number
    • getParticleGravityY(): number
    • getParticleGreen1(): number
    • getParticleGreen2(): number
    • getParticleLifeTimeMax(): number
    • getParticleLifeTimeMin(): number
    • getParticleRed1(): number
    • getParticleRed2(): number
    • getParticleRotationMaxSpeed(): number
    • getParticleRotationMinSpeed(): number
    • getParticleSize1(): number
    • getParticleSize2(): number
    • getRendererEffects(): Record<string, Filter>
    • getParticleAlpha1(): number
    • getParticleAlpha2(): number
    • getParticleBlue1(): number
    • getParticleBlue2(): number
    • getParticleCount(): number
    • getParticleGravityAngle(): number
    • getParticleGravityLength(): number
    • getParticleGravityX(): number
    • getParticleGravityY(): number
    • getParticleGreen1(): number
    • getParticleGreen2(): number
    • getParticleLifeTimeMax(): number
    • getParticleLifeTimeMin(): number
    • getParticleRed1(): number
    • getParticleRed2(): number
    • getParticleRotationMaxSpeed(): number
    • getParticleRotationMinSpeed(): number
    • getParticleSize1(): number
    • getParticleSize2(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Container<DisplayObject>
    • getRendererObject(): Container<DisplayObject>
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTank(): number
    • getTexture(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTank(): number
    • getTexture(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • getZoneRadius(): number
    • hasBehavior(name: string): boolean
    • getZoneRadius(): number
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isEmitting(): boolean
    • isHidden(): boolean
    • isEmitting(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -397,43 +397,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • jumpEmitterForwardInTime(timeSkipped: number): void
    • noMoreParticles(): boolean
    • notifyBehaviorsObjectHotReloaded(): void
    • jumpEmitterForwardInTime(timeSkipped: number): void
    • noMoreParticles(): boolean
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -444,7 +444,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -453,7 +453,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • recreateParticleSystem(): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • recreateParticleSystem(): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -479,7 +479,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    • objectData: ObjectData

    Returns void

    • removeBehavior(name: string): boolean
    • removeBehavior(name: string): boolean
    • Remove the behavior with the given name. Usually only used by hot-reloading, as performance of this operation is not guaranteed (in the future, this could lead to re-organization of arrays @@ -487,69 +487,69 @@

      Parameters

      • name: string

        The name of the behavior to remove.

      Returns boolean

      true if the behavior was properly removed, false otherwise.

      -
    • removeEffect(effectName: string): boolean
    • removeEffect(effectName: string): boolean
    • removeTimer(timerName: string): void

    Returns boolean

    • removeTimer(timerName: string): void
    • resetTimer(timerName: string): void

    Returns void

    • resetTimer(timerName: string): void

    Returns void

    • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
    • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean

    Returns void

    • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
    • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean
    • Separate the object from others objects, using their hitboxes.

      Parameters

      • objects: RuntimeObject[]

        Objects

      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if the object was moved

      -
    • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
    • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
    • Separate the object from others objects, using their hitboxes.

      Parameters

      • objectsLists: ObjectsLists

        Tables of objects

      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if the object was moved

      -
    • separateObjectsWithForces(objectsLists: ObjectsLists): void
    • separateObjectsWithForces(objectsLists: ObjectsLists): void
    • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
    • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
    • setAdditiveRendering(enabled: boolean): void
    • setAngle(angle: any): void

    Returns void

    • setAdditiveRendering(enabled: boolean): void
    • setAngle(angle: any): void
    • setCenterPositionInScene(x: number, y: number): void
    • setCenterPositionInScene(x: number, y: number): void
    • setCenterXInScene(x: number): void

    Returns void

    • setCenterXInScene(x: number): void
    • setCenterYInScene(y: number): void

    Returns void

    • setCenterYInScene(y: number): void
    • setConeSprayAngle(angle: number): void
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
    • setConeSprayAngle(angle: number): void
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean

    Returns boolean

    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean

    Returns boolean

    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean
    • setEmitterAngle(angle: number): void
    • setEmitterAngleA(angle: number): void
    • setEmitterAngleB(angle: number): void
    • setEmitterForceMax(force: number): void
    • setEmitterForceMin(force: number): void
    • setFlow(flow: number): void
    • setHeight(height: number): void

    Returns boolean

    • setEmitterAngle(angle: number): void
    • setEmitterAngleA(angle: number): void
    • setEmitterAngleB(angle: number): void
    • setEmitterForceMax(force: number): void
    • setEmitterForceMin(force: number): void
    • setFlow(flow: number): void
    • setHeight(height: number): void
    • setIncludedInParentCollisionMask(isIncluded: boolean): void
    • setLayer(layer: string): void

    Returns void

    • setIncludedInParentCollisionMask(isIncluded: boolean): void
    • setLayer(layer: string): void
    • setMaxParticlesCount(count: number): void
    • setParticleAlpha1(alpha: number): void
    • setParticleAlpha2(alpha: number): void
    • setParticleBlue1(blue: number): void
    • setParticleBlue2(blue: number): void
    • setParticleColor1(rgbColor: string): void
    • setParticleColor2(rgbColor: string): void
    • setParticleGravityAngle(angle: number): void
    • setParticleGravityLength(length: number): void
    • setParticleGravityX(x: number): void
    • setParticleGravityY(y: number): void
    • setParticleGreen1(green: number): void
    • setParticleGreen2(green: number): void
    • setParticleLifeTimeMax(lifeTime: number): void
    • setParticleLifeTimeMin(lifeTime: number): void
    • setParticleRed1(red: number): void
    • setParticleRed2(red: number): void
    • setParticleRotationMaxSpeed(speed: number): void
    • setParticleRotationMinSpeed(speed: number): void
    • setParticleSize1(size: number): void
    • setParticleSize2(size: number): void
    • setPosition(x: number, y: number): void

    Returns void

    • setMaxParticlesCount(count: number): void
    • setParticleAlpha1(alpha: number): void
    • setParticleAlpha2(alpha: number): void
    • setParticleBlue1(blue: number): void
    • setParticleBlue2(blue: number): void
    • setParticleColor1(rgbColor: string): void
    • setParticleColor2(rgbColor: string): void
    • setParticleGravityAngle(angle: number): void
    • setParticleGravityLength(length: number): void
    • setParticleGravityX(x: number): void
    • setParticleGravityY(y: number): void
    • setParticleGreen1(green: number): void
    • setParticleGreen2(green: number): void
    • setParticleLifeTimeMax(lifeTime: number): void
    • setParticleLifeTimeMin(lifeTime: number): void
    • setParticleRed1(red: number): void
    • setParticleRed2(red: number): void
    • setParticleRotationMaxSpeed(speed: number): void
    • setParticleRotationMinSpeed(speed: number): void
    • setParticleSize1(size: number): void
    • setParticleSize2(size: number): void
    • setPosition(x: number, y: number): void
    • setTank(tank: number): void
    • setVariableNumber(variable: Variable, newValue: number): void

    Returns void

    • setTank(tank: number): void
    • setVariableNumber(variable: Variable, newValue: number): void
    • setVariableString(variable: Variable, newValue: string): void

    Returns void

    • setVariableString(variable: Variable, newValue: string): void
    • setWidth(width: number): void

    Returns void

    • setWidth(width: number): void
    • setX(x: number): void

    Returns void

    • setX(x: number): void
    • setY(y: number): void
    • setY(y: number): void
    • setZOrder(z: number): void
    • setZOrder(z: number): void
    • setZoneRadius(radius: number): void
    • startEmission(): void

    Returns void

    • setZoneRadius(radius: number): void
    • startEmission(): void
    • stopEmission(): void
    • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
    • stopEmission(): void
    • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
    • Compare a timer elapsed time. If the timer does not exist, it is created.

      deprecated

      prefer using getTimerElapsedTimeInSecondsOrNaN.

      Parameters

      • timerName: string
        @@ -625,168 +625,168 @@
      • timeInSeconds: number

        The time value to check in seconds.

      Returns boolean

      True if the timer exists and its value is greater than or equal than the given time, false otherwise.

      -
    • timerPaused(timerName: string): boolean
    • timerPaused(timerName: string): boolean
    • unpauseTimer(timerName: string): void
    • unpauseTimer(timerName: string): void
    • unregisterDestroyCallback(callback: () => void): void

    Returns void

    • unregisterDestroyCallback(callback: () => void): void
    • updateAABB(): void
    • updateAABB(): void
    • Update the AABB (axis aligned bounding box) for the object.

      Default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box.

      You should not call this function by yourself, it is called when necessary by getAABB method. However, you can redefine it if your object can have a faster implementation.

      -

      Returns void

    • updateAllEffectParameters(effectData: EffectData): boolean
    • updateAllEffectParameters(effectData: EffectData): boolean
    • updateForces(elapsedTime: number): void

    Returns boolean

    • updateForces(elapsedTime: number): void
    • updateHitBoxes(): void
    • updateHitBoxes(): void
    • Update the hit boxes for the object.

      The default implementation set a basic bounding box based on the size (getWidth and getHeight) and the center point of the object (getCenterX and getCenterY). Result is cached until invalidated (by a position change, angle change...).

      You should not call this function by yourself, it is called when necessary by getHitBoxes method. However, you can redefine it if your object need custom hit boxes.

      -

      Returns void

    • updateTimers(elapsedTime: number): void

    Returns void

    • updateTimers(elapsedTime: number): void

    Properties

    additiveRendering: boolean
    alpha1: number
    alpha2: number
    angle: number = 0
    angleA: number
    deprecated

    Data not used

    -
    angleB: number
    colorB1: number
    colorB2: number
    colorG1: number
    colorG2: number
    colorR1: number
    colorR2: number
    destroyWhenNoParticles: boolean
    flow: number
    forceMax: number
    forceMin: number
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    additiveRendering: boolean
    alpha1: number
    alpha2: number
    angle: number = 0
    angleA: number
    deprecated

    Data not used

    +
    angleB: number
    colorB1: number
    colorB2: number
    colorG1: number
    colorG2: number
    colorR1: number
    colorR2: number
    destroyWhenNoParticles: boolean
    flow: number
    forceMax: number
    forceMin: number
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    gravityX: number
    gravityY: number
    hidden: boolean = false
    id: number
    jumpForwardInTimeOnCreation: number
    layer: string = ''
    lifeTimeMax: number
    lifeTimeMin: number
    maxParticlesCount: number
    name: string
    networkId: null | string = null
    +
    gravityX: number
    gravityY: number
    hidden: boolean = false
    id: number
    jumpForwardInTimeOnCreation: number
    layer: string = ''
    lifeTimeMax: number
    lifeTimeMin: number
    maxParticlesCount: number
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    particleRotationMaxSpeed: number
    particleRotationMinSpeed: number
    persistentUuid: null | string = null
    +
    particleRotationMaxSpeed: number
    particleRotationMinSpeed: number
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    rendererParam1: number
    rendererParam2: number
    rendererType: string
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    rendererParam1: number
    rendererParam2: number
    rendererType: string
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    size1: number
    size2: number
    supportsReinitialization: boolean = false
    tank: number
    texture: string
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    size1: number
    size2: number
    supportsReinitialization: boolean = false
    tank: number
    texture: string
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    zoneRadius: number
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    zoneRadius: number
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • activated(): boolean
    • enableSynchronization(enable: boolean): void
    • getCost(): number
    • getName(): string
    • enableSynchronization(enable: boolean): void
    • getCost(): number
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isImpassable(): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isImpassable(): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • onObjectHotReloaded(): void
    • onObjectHotReloaded(): void
    • setCost(cost: number): void
    • setImpassable(impassable: boolean): void
    • setCost(cost: number): void
    • setImpassable(impassable: boolean): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    currentRBushAABB: null | BehaviorRBushAABB<PathfindingObstacleRuntimeBehavior> = null
    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Internal tool class representing a node when looking for a path

    -

    Hierarchy

    • Node

    Index

    Constructors

    • new Node(xPos: number, yPos: number): Node

    Properties

    cost: number = 0
    estimateCost: number = -1
    open: boolean = true
    parent: null | Node = null
    pos: FloatPoint
    smallestCost: number = -1

    Methods

    • reinitialize(xPos: number, yPos: number): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    PathfindingRuntimeBehavior represents a behavior allowing objects to follow a path computed to avoid obstacles.

    -

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • allowDiagonals(allow: boolean): void
    • destinationReached(): boolean
    • allowDiagonals(allow: boolean): void
    • destinationReached(): boolean
    • diagonalsAllowed(): boolean
    • diagonalsAllowed(): boolean
    • enableSynchronization(enable: boolean): void
    • euclideanDistance(a: FloatPoint, b: FloatPoint): number
    • enableSynchronization(enable: boolean): void
    • euclideanDistance(a: FloatPoint, b: FloatPoint): number
    • getAcceleration(): number
    • getAngleOffset(): number
    • getAngularMaxSpeed(): number
    • getCellHeight(): number
    • getCellWidth(): number
    • getDestinationX(): number
    • getDestinationY(): number
    • getExtraBorder(): number
    • getGridOffsetX(): number
    • getGridOffsetY(): number
    • getLastNodeX(): number
    • getLastNodeY(): number
    • getMaxSpeed(): number
    • getMovementAngle(): number
    • getName(): string
    • getAcceleration(): number
    • getAngleOffset(): number
    • getAngularMaxSpeed(): number
    • getCellHeight(): number
    • getCellWidth(): number
    • getDestinationX(): number
    • getDestinationY(): number
    • getExtraBorder(): number
    • getGridOffsetX(): number
    • getGridOffsetY(): number
    • getLastNodeX(): number
    • getLastNodeY(): number
    • getMaxSpeed(): number
    • getMovementAngle(): number
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNextNodeIndex(): number
    • getNextNodeX(): number
    • getNextNodeY(): number
    • getNodeCount(): number
    • getNodeX(index: number): number
    • getNodeY(index: number): number
    • getSpeed(): number
    • isObjectRotated(): boolean
    • isSyncedOverNetwork(): boolean
    • manhattanDistance(a: FloatPoint, b: FloatPoint): number
    • getNextNodeIndex(): number
    • getNextNodeX(): number
    • getNextNodeY(): number
    • getNodeCount(): number
    • getNodeX(index: number): number
    • getNodeY(index: number): number
    • getSpeed(): number
    • isObjectRotated(): boolean
    • isSyncedOverNetwork(): boolean
    • manhattanDistance(a: FloatPoint, b: FloatPoint): number
    • movementAngleIsAround(degreeAngle: number, tolerance: number): boolean
    • onActivate(): void
    • movementAngleIsAround(degreeAngle: number, tolerance: number): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • pathFound(): boolean
    • pathFound(): boolean
    • setAcceleration(acceleration: number): void
    • setAngleOffset(angleOffset: number): void
    • setAngularMaxSpeed(angularMaxSpeed: number): void
    • setCellHeight(height: number): void
    • setCellWidth(width: number): void
    • setExtraBorder(extraBorder: any): void
    • setGridOffsetX(gridOffsetX: number): void
    • setGridOffsetY(gridOffsetY: number): void
    • setMaxSpeed(maxSpeed: number): void
    • setRotateObject(allow: boolean): void
    • setSpeed(speed: number): void
    • setAcceleration(acceleration: number): void
    • setAngleOffset(angleOffset: number): void
    • setAngularMaxSpeed(angularMaxSpeed: number): void
    • setCellHeight(height: number): void
    • setCellWidth(width: number): void
    • setExtraBorder(extraBorder: any): void
    • setGridOffsetX(gridOffsetX: number): void
    • setGridOffsetY(gridOffsetY: number): void
    • setMaxSpeed(maxSpeed: number): void
    • setRotateObject(allow: boolean): void
    • setSpeed(speed: number): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • usesLifecycleFunction(): boolean
    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Methods

    Properties

    Constructors

    Methods

    • activate(enable: boolean): void
    • activated(): boolean
    • addDistanceJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, length: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
    • addFrictionJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, maxForce: number, maxTorque: number, collideConnected: boolean, variable: Variable): void
    • addGearJoint(jointId1: any, jointId2: any, ratio: any, collideConnected: any, variable: any): void
    • addMotorJoint(other: null | RuntimeObject, offsetX: number, offsetY: number, offsetAngle: number, maxForce: number, maxTorque: number, correctionFactor: number, collideConnected: boolean, variable: Variable): void
    • addMouseJoint(targetX: number, targetY: number, maxForce: number, frequency: number, dampingRatio: number, variable: Variable): void
    • addPrismaticJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, axisAngle: number, referenceAngle: number, enableLimit: boolean, lowerTranslation: number, upperTranslation: number, enableMotor: boolean, motorSpeed: number, maxMotorForce: number, collideConnected: boolean, variable: Variable): void
    • addPulleyJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, groundX1: number, groundY1: number, groundX2: number, groundY2: number, lengthA: number, lengthB: number, ratio: number, collideConnected: boolean, variable: Variable): void
    • addRevoluteJoint(x: number, y: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, variable: Variable): void
    • addRevoluteJointBetweenTwoBodies(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
    • addRopeJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, maxLength: number, collideConnected: boolean, variable: Variable): void
    • addWeldJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, referenceAngle: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
    • addWheelJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, axisAngle: number, frequency: number, dampingRatio: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
    • applyAngularImpulse(angularImpulse: number): void
    • applyForce(forceX: number, forceY: number, positionX: number, positionY: number): void
    • applyForceTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
    • applyImpulse(impulseX: number, impulseY: number, positionX: number, positionY: number): void
    • applyImpulseTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
    • applyPolarForce(angle: number, length: number, positionX: number, positionY: number): void
    • applyPolarImpulse(angle: number, length: number, positionX: number, positionY: number): void
    • applyTorque(torque: number): void
    • b2Vec2(x: number, y: number): b2Vec2
    • b2Vec2Sec(x: number, y: number): b2Vec2
    • createBody(): boolean
    • createShape(): b2FixtureDef
    • addDistanceJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, length: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
    • addFrictionJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, maxForce: number, maxTorque: number, collideConnected: boolean, variable: Variable): void
    • addGearJoint(jointId1: any, jointId2: any, ratio: any, collideConnected: any, variable: any): void
    • addMotorJoint(other: null | RuntimeObject, offsetX: number, offsetY: number, offsetAngle: number, maxForce: number, maxTorque: number, correctionFactor: number, collideConnected: boolean, variable: Variable): void
    • addMouseJoint(targetX: number, targetY: number, maxForce: number, frequency: number, dampingRatio: number, variable: Variable): void
    • addPrismaticJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, axisAngle: number, referenceAngle: number, enableLimit: boolean, lowerTranslation: number, upperTranslation: number, enableMotor: boolean, motorSpeed: number, maxMotorForce: number, collideConnected: boolean, variable: Variable): void
    • addPulleyJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, groundX1: number, groundY1: number, groundX2: number, groundY2: number, lengthA: number, lengthB: number, ratio: number, collideConnected: boolean, variable: Variable): void
    • addRevoluteJoint(x: number, y: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, variable: Variable): void
    • addRevoluteJointBetweenTwoBodies(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, enableLimit: boolean, referenceAngle: number, lowerAngle: number, upperAngle: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
    • addRopeJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, maxLength: number, collideConnected: boolean, variable: Variable): void
    • addWeldJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, referenceAngle: number, frequency: number, dampingRatio: number, collideConnected: boolean, variable: Variable): void
    • addWheelJoint(x1: number, y1: number, other: null | RuntimeObject, x2: number, y2: number, axisAngle: number, frequency: number, dampingRatio: number, enableMotor: boolean, motorSpeed: number, maxMotorTorque: number, collideConnected: boolean, variable: Variable): void
    • applyAngularImpulse(angularImpulse: number): void
    • applyForce(forceX: number, forceY: number, positionX: number, positionY: number): void
    • applyForceTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
    • applyImpulse(impulseX: number, impulseY: number, positionX: number, positionY: number): void
    • applyImpulseTowardPosition(length: number, towardX: number, towardY: number, positionX: number, positionY: number): void
    • applyPolarForce(angle: number, length: number, positionX: number, positionY: number): void
    • applyPolarImpulse(angle: number, length: number, positionX: number, positionY: number): void
    • applyTorque(torque: number): void
    • b2Vec2(x: number, y: number): b2Vec2
    • b2Vec2Sec(x: number, y: number): b2Vec2
    • createBody(): boolean
    • createShape(): b2FixtureDef
    • enableLayer(layer: number, enable: boolean): void
    • enableMask(mask: number, enable: boolean): void
    • enablePrismaticJointLimits(jointId: string | number, enable: boolean): void
    • enablePrismaticJointMotor(jointId: string | number, enable: boolean): void
    • enableRevoluteJointLimits(jointId: string | number, enable: boolean): void
    • enableRevoluteJointMotor(jointId: string | number, enable: any): void
    • enableSynchronization(enable: boolean): void
    • enableWheelJointMotor(jointId: string | number, enable: any): void
    • getAngularDamping(): number
    • getAngularVelocity(): number
    • getBody(): b2Body
    • getDensity(): number
    • getDistanceJointDampingRatio(jointId: string | number): number
    • getDistanceJointFrequency(jointId: string | number): number
    • getDistanceJointLength(jointId: string | number): number
    • getFriction(): number
    • getFrictionJointMaxForce(jointId: string | number): number
    • getFrictionJointMaxTorque(jointId: string | number): number
    • getGearJointFirstJoint(jointId: string | number): number
    • getGearJointRatio(jointId: string | number): number
    • getGearJointSecondJoint(jointId: string | number): number
    • getGravityScale(): number
    • getGravityX(): number
    • getGravityY(): number
    • getInertia(): number
    • getJointFirstAnchorX(jointId: string | number): number
    • getJointFirstAnchorY(jointId: string | number): number
    • getJointReactionForce(jointId: string | number): number
    • getJointReactionTorque(jointId: string | number): number
    • getJointSecondAnchorX(jointId: string | number): number
    • getJointSecondAnchorY(jointId: string | number): number
    • getLinearDamping(): number
    • getLinearVelocityAngle(): number
    • getLinearVelocityLength(): number
    • getLinearVelocityX(): number
    • getLinearVelocityY(): number
    • getMass(): number
    • getMassCenterX(): number
    • getMassCenterY(): number
    • getMotorJointAngularOffset(jointId: string | number): number
    • getMotorJointCorrectionFactor(jointId: string | number): number
    • getMotorJointMaxForce(jointId: string | number): number
    • getMotorJointMaxTorque(jointId: string | number): number
    • getMotorJointOffsetX(jointId: string | number): number
    • getMotorJointOffsetY(jointId: string | number): number
    • getMouseJointDampingRatio(jointId: string | number): number
    • getMouseJointFrequency(jointId: string | number): number
    • getMouseJointMaxForce(jointId: string | number): number
    • getMouseJointTargetX(jointId: string | number): number
    • getMouseJointTargetY(jointId: string | number): number
    • getName(): string
    • enableLayer(layer: number, enable: boolean): void
    • enableMask(mask: number, enable: boolean): void
    • enablePrismaticJointLimits(jointId: string | number, enable: boolean): void
    • enablePrismaticJointMotor(jointId: string | number, enable: boolean): void
    • enableRevoluteJointLimits(jointId: string | number, enable: boolean): void
    • enableRevoluteJointMotor(jointId: string | number, enable: any): void
    • enableSynchronization(enable: boolean): void
    • enableWheelJointMotor(jointId: string | number, enable: any): void
    • getAngularDamping(): number
    • getAngularVelocity(): number
    • getBody(): b2Body
    • getDensity(): number
    • getDistanceJointDampingRatio(jointId: string | number): number
    • getDistanceJointFrequency(jointId: string | number): number
    • getDistanceJointLength(jointId: string | number): number
    • getFriction(): number
    • getFrictionJointMaxForce(jointId: string | number): number
    • getFrictionJointMaxTorque(jointId: string | number): number
    • getGearJointFirstJoint(jointId: string | number): number
    • getGearJointRatio(jointId: string | number): number
    • getGearJointSecondJoint(jointId: string | number): number
    • getGravityScale(): number
    • getGravityX(): number
    • getGravityY(): number
    • getInertia(): number
    • getJointFirstAnchorX(jointId: string | number): number
    • getJointFirstAnchorY(jointId: string | number): number
    • getJointReactionForce(jointId: string | number): number
    • getJointReactionTorque(jointId: string | number): number
    • getJointSecondAnchorX(jointId: string | number): number
    • getJointSecondAnchorY(jointId: string | number): number
    • getLinearDamping(): number
    • getLinearVelocityAngle(): number
    • getLinearVelocityLength(): number
    • getLinearVelocityX(): number
    • getLinearVelocityY(): number
    • getMass(): number
    • getMassCenterX(): number
    • getMassCenterY(): number
    • getMotorJointAngularOffset(jointId: string | number): number
    • getMotorJointCorrectionFactor(jointId: string | number): number
    • getMotorJointMaxForce(jointId: string | number): number
    • getMotorJointMaxTorque(jointId: string | number): number
    • getMotorJointOffsetX(jointId: string | number): number
    • getMotorJointOffsetY(jointId: string | number): number
    • getMouseJointDampingRatio(jointId: string | number): number
    • getMouseJointFrequency(jointId: string | number): number
    • getMouseJointMaxForce(jointId: string | number): number
    • getMouseJointTargetX(jointId: string | number): number
    • getMouseJointTargetY(jointId: string | number): number
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getPolygon(verticesData: b2Vec2[]): null | Polygon
    • getPrismaticJointAxisAngle(jointId: string | number): number
    • getPrismaticJointMaxMotorForce(jointId: string | number): number
    • getPrismaticJointMaxTranslation(jointId: string | number): number
    • getPrismaticJointMinTranslation(jointId: string | number): number
    • getPrismaticJointMotorForce(jointId: string | number): number
    • getPrismaticJointMotorSpeed(jointId: string | number): number
    • getPrismaticJointReferenceAngle(jointId: string | number): number
    • getPrismaticJointSpeed(jointId: string | number): number
    • getPrismaticJointTranslation(jointId: string | number): number
    • getPulleyJointFirstGroundAnchorX(jointId: string | number): number
    • getPulleyJointFirstGroundAnchorY(jointId: string | number): number
    • getPulleyJointFirstLength(jointId: string | number): number
    • getPulleyJointRatio(jointId: string | number): number
    • getPulleyJointSecondGroundAnchorX(jointId: string | number): number
    • getPulleyJointSecondGroundAnchorY(jointId: string | number): number
    • getPulleyJointSecondLength(jointId: string | number): number
    • getRestitution(): number
    • getRevoluteJointAngle(jointId: string | number): number
    • getRevoluteJointMaxAngle(jointId: string | number): number
    • getRevoluteJointMaxMotorTorque(jointId: string | number): number
    • getRevoluteJointMinAngle(jointId: string | number): number
    • getRevoluteJointMotorSpeed(jointId: string | number): number
    • getRevoluteJointMotorTorque(jointId: string | number): number
    • getRevoluteJointReferenceAngle(jointId: string | number): number
    • getRevoluteJointSpeed(jointId: string | number): number
    • getRopeJointMaxLength(jointId: string | number): number
    • getShapeScale(): number
    • getTimeScale(): number
    • getWeldJointDampingRatio(jointId: string | number): number
    • getWeldJointFrequency(jointId: string | number): number
    • getWeldJointReferenceAngle(jointId: string | number): number
    • getWheelJointAxisAngle(jointId: string | number): number
    • getWheelJointDampingRatio(jointId: string | number): number
    • getWheelJointFrequency(jointId: string | number): number
    • getWheelJointMaxMotorTorque(jointId: string | number): number
    • getWheelJointMotorSpeed(jointId: string | number): number
    • getWheelJointMotorTorque(jointId: string | number): number
    • getWheelJointSpeed(jointId: string | number): number
    • getWheelJointTranslation(jointId: string | number): number
    • hasFixedRotation(): boolean
    • isBullet(): boolean
    • isDynamic(): boolean
    • isJointFirstObject(jointId: string | number): boolean
    • isJointSecondObject(jointId: string | number): boolean
    • isKinematic(): boolean
    • isPolygonConvex(polygon: Polygon): boolean
    • isPrismaticJointLimitsEnabled(jointId: string | number): boolean
    • isPrismaticJointMotorEnabled(jointId: string | number): boolean
    • isRevoluteJointLimitsEnabled(jointId: string | number): boolean
    • isRevoluteJointMotorEnabled(jointId: string | number): boolean
    • isSleeping(): boolean
    • isSleepingAllowed(): boolean
    • isStatic(): boolean
    • isSyncedOverNetwork(): boolean
    • isWheelJointMotorEnabled(jointId: string | number): boolean
    • layerEnabled(layer: number): boolean
    • maskEnabled(mask: number): boolean
    • onActivate(): void
    • getPolygon(verticesData: b2Vec2[]): null | Polygon
    • getPrismaticJointAxisAngle(jointId: string | number): number
    • getPrismaticJointMaxMotorForce(jointId: string | number): number
    • getPrismaticJointMaxTranslation(jointId: string | number): number
    • getPrismaticJointMinTranslation(jointId: string | number): number
    • getPrismaticJointMotorForce(jointId: string | number): number
    • getPrismaticJointMotorSpeed(jointId: string | number): number
    • getPrismaticJointReferenceAngle(jointId: string | number): number
    • getPrismaticJointSpeed(jointId: string | number): number
    • getPrismaticJointTranslation(jointId: string | number): number
    • getPulleyJointFirstGroundAnchorX(jointId: string | number): number
    • getPulleyJointFirstGroundAnchorY(jointId: string | number): number
    • getPulleyJointFirstLength(jointId: string | number): number
    • getPulleyJointRatio(jointId: string | number): number
    • getPulleyJointSecondGroundAnchorX(jointId: string | number): number
    • getPulleyJointSecondGroundAnchorY(jointId: string | number): number
    • getPulleyJointSecondLength(jointId: string | number): number
    • getRestitution(): number
    • getRevoluteJointAngle(jointId: string | number): number
    • getRevoluteJointMaxAngle(jointId: string | number): number
    • getRevoluteJointMaxMotorTorque(jointId: string | number): number
    • getRevoluteJointMinAngle(jointId: string | number): number
    • getRevoluteJointMotorSpeed(jointId: string | number): number
    • getRevoluteJointMotorTorque(jointId: string | number): number
    • getRevoluteJointReferenceAngle(jointId: string | number): number
    • getRevoluteJointSpeed(jointId: string | number): number
    • getRopeJointMaxLength(jointId: string | number): number
    • getShapeScale(): number
    • getTimeScale(): number
    • getWeldJointDampingRatio(jointId: string | number): number
    • getWeldJointFrequency(jointId: string | number): number
    • getWeldJointReferenceAngle(jointId: string | number): number
    • getWheelJointAxisAngle(jointId: string | number): number
    • getWheelJointDampingRatio(jointId: string | number): number
    • getWheelJointFrequency(jointId: string | number): number
    • getWheelJointMaxMotorTorque(jointId: string | number): number
    • getWheelJointMotorSpeed(jointId: string | number): number
    • getWheelJointMotorTorque(jointId: string | number): number
    • getWheelJointSpeed(jointId: string | number): number
    • getWheelJointTranslation(jointId: string | number): number
    • hasFixedRotation(): boolean
    • isBullet(): boolean
    • isDynamic(): boolean
    • isJointFirstObject(jointId: string | number): boolean
    • isJointSecondObject(jointId: string | number): boolean
    • isKinematic(): boolean
    • isPolygonConvex(polygon: Polygon): boolean
    • isPrismaticJointLimitsEnabled(jointId: string | number): boolean
    • isPrismaticJointMotorEnabled(jointId: string | number): boolean
    • isRevoluteJointLimitsEnabled(jointId: string | number): boolean
    • isRevoluteJointMotorEnabled(jointId: string | number): boolean
    • isSleeping(): boolean
    • isSleepingAllowed(): boolean
    • isStatic(): boolean
    • isSyncedOverNetwork(): boolean
    • isWheelJointMotorEnabled(jointId: string | number): boolean
    • layerEnabled(layer: number): boolean
    • maskEnabled(mask: number): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • recreateShape(): void
    • removeJoint(jointId: string | number): void
    • setAngularDamping(angularDamping: number): void
    • setAngularVelocity(angularVelocity: number): void
    • setBullet(enable: boolean): void
    • setDensity(density: number): void
    • setDistanceJointDampingRatio(jointId: string | number, dampingRatio: number): void
    • setDistanceJointFrequency(jointId: string | number, frequency: number): void
    • setDistanceJointLength(jointId: string | number, length: number): void
    • setDynamic(): void
    • setFixedRotation(enable: boolean): void
    • setFriction(friction: any): void
    • setFrictionJointMaxForce(jointId: string | number, maxForce: number): void
    • setFrictionJointMaxTorque(jointId: string | number, maxTorque: number): void
    • setGearJointRatio(jointId: string | number, ratio: number): void
    • setGravity(x: number, y: number): void
    • setGravityScale(gravityScale: number): void
    • setKinematic(): void
    • setLinearDamping(linearDamping: number): void
    • setLinearVelocityAngle(angle: number, linearVelocity: number): void
    • setLinearVelocityX(linearVelocityX: number): void
    • setLinearVelocityY(linearVelocityY: number): void
    • setMotorJointAngularOffset(jointId: string | number, offsetAngle: number): void
    • setMotorJointCorrectionFactor(jointId: string | number, correctionFactor: number): void
    • setMotorJointMaxForce(jointId: string | number, maxForce: number): void
    • setMotorJointMaxTorque(jointId: string | number, maxTorque: number): void
    • setMotorJointOffset(jointId: string | number, offsetX: number, offsetY: number): void
    • setMouseJointDampingRatio(jointId: string | number, dampingRatio: number): void
    • setMouseJointFrequency(jointId: string | number, frequency: number): void
    • setMouseJointMaxForce(jointId: string | number, maxForce: number): void
    • setMouseJointTarget(jointId: string | number, targetX: number, targetY: number): void
    • setPrismaticJointLimits(jointId: string | number, lowerTranslation: number, upperTranslation: number): void
    • setPrismaticJointMaxMotorForce(jointId: string | number, maxForce: any): void
    • setPrismaticJointMotorSpeed(jointId: string | number, speed: any): void
    • setRestitution(restitution: number): void
    • setRevoluteJointLimits(jointId: string | number, lowerAngle: number, upperAngle: number): void
    • setRevoluteJointMaxMotorTorque(jointId: string | number, maxTorque: any): void
    • setRevoluteJointMotorSpeed(jointId: string | number, speed: any): void
    • setRopeJointMaxLength(jointId: string | number, maxLength: number): void
    • setShapeScale(shapeScale: number): void
    • setSleepingAllowed(enable: boolean): void
    • setStatic(): void
    • setTimeScale(timeScale: number): void
    • setTimeScaleFromObject(object: any, behaviorName: any, timeScale: any): void
    • setWeldJointDampingRatio(jointId: string | number, dampingRatio: number): void
    • setWeldJointFrequency(jointId: string | number, frequency: number): void
    • setWheelJointDampingRatio(jointId: string | number, dampingRatio: any): void
    • setWheelJointFrequency(jointId: string | number, frequency: any): void
    • setWheelJointMaxMotorTorque(jointId: string | number, maxTorque: number): void
    • setWheelJointMotorSpeed(jointId: string | number, speed: any): void
    • recreateShape(): void
    • removeJoint(jointId: string | number): void
    • setAngularDamping(angularDamping: number): void
    • setAngularVelocity(angularVelocity: number): void
    • setBullet(enable: boolean): void
    • setDensity(density: number): void
    • setDistanceJointDampingRatio(jointId: string | number, dampingRatio: number): void
    • setDistanceJointFrequency(jointId: string | number, frequency: number): void
    • setDistanceJointLength(jointId: string | number, length: number): void
    • setDynamic(): void
    • setFixedRotation(enable: boolean): void
    • setFriction(friction: any): void
    • setFrictionJointMaxForce(jointId: string | number, maxForce: number): void
    • setFrictionJointMaxTorque(jointId: string | number, maxTorque: number): void
    • setGearJointRatio(jointId: string | number, ratio: number): void
    • setGravity(x: number, y: number): void
    • setGravityScale(gravityScale: number): void
    • setKinematic(): void
    • setLinearDamping(linearDamping: number): void
    • setLinearVelocityAngle(angle: number, linearVelocity: number): void
    • setLinearVelocityX(linearVelocityX: number): void
    • setLinearVelocityY(linearVelocityY: number): void
    • setMotorJointAngularOffset(jointId: string | number, offsetAngle: number): void
    • setMotorJointCorrectionFactor(jointId: string | number, correctionFactor: number): void
    • setMotorJointMaxForce(jointId: string | number, maxForce: number): void
    • setMotorJointMaxTorque(jointId: string | number, maxTorque: number): void
    • setMotorJointOffset(jointId: string | number, offsetX: number, offsetY: number): void
    • setMouseJointDampingRatio(jointId: string | number, dampingRatio: number): void
    • setMouseJointFrequency(jointId: string | number, frequency: number): void
    • setMouseJointMaxForce(jointId: string | number, maxForce: number): void
    • setMouseJointTarget(jointId: string | number, targetX: number, targetY: number): void
    • setPrismaticJointLimits(jointId: string | number, lowerTranslation: number, upperTranslation: number): void
    • setPrismaticJointMaxMotorForce(jointId: string | number, maxForce: any): void
    • setPrismaticJointMotorSpeed(jointId: string | number, speed: any): void
    • setRestitution(restitution: number): void
    • setRevoluteJointLimits(jointId: string | number, lowerAngle: number, upperAngle: number): void
    • setRevoluteJointMaxMotorTorque(jointId: string | number, maxTorque: any): void
    • setRevoluteJointMotorSpeed(jointId: string | number, speed: any): void
    • setRopeJointMaxLength(jointId: string | number, maxLength: number): void
    • setShapeScale(shapeScale: number): void
    • setSleepingAllowed(enable: boolean): void
    • setStatic(): void
    • setTimeScale(timeScale: number): void
    • setTimeScaleFromObject(object: any, behaviorName: any, timeScale: any): void
    • setWeldJointDampingRatio(jointId: string | number, dampingRatio: number): void
    • setWeldJointFrequency(jointId: string | number, frequency: number): void
    • setWheelJointDampingRatio(jointId: string | number, dampingRatio: any): void
    • setWheelJointFrequency(jointId: string | number, frequency: any): void
    • setWheelJointMaxMotorTorque(jointId: string | number, maxTorque: number): void
    • setWheelJointMotorSpeed(jointId: string | number, speed: any): void

    Returns void

    • updateBodyFromObject(): void
    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateBodyFromObject(): void
    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • usesLifecycleFunction(): boolean
    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Properties

    angularDamping: number
    bodyType: string
    bullet: boolean
    canSleep: boolean
    collisionTest: (object1: RuntimeObject, object2: RuntimeObject, behaviorName: string) => boolean = Physics2RuntimeBehavior.areObjectsColliding

    Type declaration

    contactsEndedThisFrame: Physics2RuntimeBehavior[]
    +

    Returns boolean

    Properties

    angularDamping: number
    bodyType: string
    bullet: boolean
    canSleep: boolean
    collisionTest: (object1: RuntimeObject, object2: RuntimeObject, behaviorName: string) => boolean = Physics2RuntimeBehavior.areObjectsColliding

    Type declaration

    contactsEndedThisFrame: Physics2RuntimeBehavior[]

    Array containing the end of contacts reported by onContactEnd. The array is updated each time the method onContactEnd is called by the listener, which can be called at any time. This array is cleared just before stepping the world.

    -
    contactsStartedThisFrame: Physics2RuntimeBehavior[]
    +
    contactsStartedThisFrame: Physics2RuntimeBehavior[]

    Array containing the beginning of contacts reported by onContactBegin. Each contact should be unique to avoid recording glitches where the object loses and regain contact between two frames. The array is updated each time the method onContactBegin is called by the listener, which is only called when stepping the world i.e. in the first preEvent called by a physics behavior. This array is cleared just before stepping the world.

    -
    currentContacts: Physics2RuntimeBehavior[]
    +
    currentContacts: Physics2RuntimeBehavior[]

    Array containing the exact current contacts with the objects. It is updated each time the methods onContactBegin and onContactEnd are called by the contact listener.

    -
    density: number
    destroyedDuringFrameLogic: boolean
    fixedRotation: boolean
    friction: number
    gravityScale: number
    layers: number
    linearDamping: number
    masks: number
    name: string
    polygon: null | Polygon
    polygonOrigin: string
    restitution: number
    shape: string
    shapeDimensionA: any
    shapeDimensionB: any
    shapeOffsetX: number
    shapeOffsetY: number
    shapeScale: number = 1
    type: string

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • Physics2SharedData

    Index

    Methods

    • addJoint(joint: b2Joint): number

    Constructors

    Properties

    contactListener: JSContactListener

    Contact listener to keep track of current collisions

    -
    frameTime: number = 0
    gravityX: number
    gravityY: number
    invScaleX: number
    invScaleY: number
    joints: {} = {}
    +
    frameTime: number = 0
    gravityX: number
    gravityY: number
    invScaleX: number
    invScaleY: number
    joints: {} = {}

    Start with 1 so the user is safe from default variables value (0)

    -

    Type declaration

    • [key: string]: Box2D.b2Joint
    scaleX: number
    scaleY: number
    staticBody: b2Body
    stepped: boolean = false
    timeScale: number = 1
    timeStep: number
    world: b2World

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Allows objects to be moved in a realistic way thanks to a physics engine (Box2D).

    -

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • addGearJointBetweenObjects(object: any, ratio: any): void
    • addRevoluteJoint(xPosition: any, yPosition: any): void
    • addRevoluteJointBetweenObjects(object: any, scene: any, xPosRelativeToMassCenter: any, yPosRelativeToMassCenter: any): void
    • applyForce(xCoordinate: any, yCoordinate: any): void
    • applyForceTowardPosition(xPosition: any, yPosition: any, length: any): void
    • applyForceUsingPolarCoordinates(angle: any, length: any): void
    • applyImpulse(xCoordinate: any, yCoordinate: any): void
    • applyImpulseTowardPosition(xPosition: any, yPosition: any, length: any): void
    • applyImpulseUsingPolarCoordinates(angle: any, length: any): void
    • applyTorque(torque: any): void
    • b2Vec2(x: any, y: any): any
    • addGearJointBetweenObjects(object: any, ratio: any): void
    • addRevoluteJoint(xPosition: any, yPosition: any): void
    • addRevoluteJointBetweenObjects(object: any, scene: any, xPosRelativeToMassCenter: any, yPosRelativeToMassCenter: any): void
    • applyForce(xCoordinate: any, yCoordinate: any): void
    • applyForceTowardPosition(xPosition: any, yPosition: any, length: any): void
    • applyForceUsingPolarCoordinates(angle: any, length: any): void
    • applyImpulse(xCoordinate: any, yCoordinate: any): void
    • applyImpulseTowardPosition(xPosition: any, yPosition: any, length: any): void
    • applyImpulseUsingPolarCoordinates(angle: any, length: any): void
    • applyTorque(torque: any): void
    • b2Vec2(x: any, y: any): any
    • collisionWith(otherObjectsTable: any): boolean
    • createBody(): void
    • doStepPostEvents(runtimeScene: any): void
    • collisionWith(otherObjectsTable: any): boolean
    • createBody(): void
    • doStepPostEvents(runtimeScene: any): void
    • doStepPreEvents(runtimeScene: any): void
    • doStepPreEvents(runtimeScene: any): void
    • dontSetAsBullet(): void
    • enableSynchronization(enable: boolean): void
    • getAngularDamping(): any
    • getAngularVelocity(): any
    • getBox2DBody(): any
    • getLinearDamping(): any
    • getLinearVelocity(): number
    • getLinearVelocityX(): number
    • getLinearVelocityY(): number
    • getName(): string
    • dontSetAsBullet(): void
    • enableSynchronization(enable: boolean): void
    • getAngularDamping(): any
    • getAngularVelocity(): any
    • getBox2DBody(): any
    • getLinearDamping(): any
    • getLinearVelocity(): number
    • getLinearVelocityX(): number
    • getLinearVelocityY(): number
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isDynamic(): boolean
    • isStatic(): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isDynamic(): boolean
    • isStatic(): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • setAngularDamping(angularDamping: any): void
    • setAngularVelocity(angularVelocity: any): void
    • setAsBullet(): void
    • setDynamic(): void
    • setFixedRotation(): void
    • setFreeRotation(): void
    • setGravity(xGravity: any, yGravity: any): void
    • setLinearDamping(linearDamping: any): void
    • setLinearVelocity(xVelocity: any, yVelocity: any): void
    • setLinearVelocityX(xVelocity: any): void
    • setLinearVelocityY(yVelocity: any): void
    • setStatic(): void
    • setAngularDamping(angularDamping: any): void
    • setAngularVelocity(angularVelocity: any): void
    • setAsBullet(): void
    • setDynamic(): void
    • setFixedRotation(): void
    • setFreeRotation(): void
    • setGravity(xGravity: any, yGravity: any): void
    • setLinearDamping(linearDamping: any): void
    • setLinearVelocity(xVelocity: any, yVelocity: any): void
    • setLinearVelocityX(xVelocity: any): void
    • setLinearVelocityY(yVelocity: any): void
    • setStatic(): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    currentContacts: any = []
    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Manage the common objects shared by objects having a physics behavior.

    -

    Hierarchy

    • PhysicsSharedData

    Index

    Constructors

    Properties

    contactListener: any
    fixedTimeStep: any
    invScaleX: any
    invScaleY: any
    scaleX: any
    scaleY: any
    staticBody: any
    stepped: boolean = false
    totalTime: number = 0
    world: any

    Methods

    • getSharedData(runtimeScene: any, name: any): any

    Hierarchy

    • PhysicsSharedData

    Index

    Constructors

    Properties

    contactListener: any
    fixedTimeStep: any
    invScaleX: any
    invScaleY: any
    scaleX: any
    scaleY: any
    staticBody: any
    stepped: boolean = false
    totalTime: number = 0
    world: any

    Methods

    • getSharedData(runtimeScene: any, name: any): any
    • step(dt: any): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    PixiBitmapFontManager loads fnt/xml files (using fetch), from the "bitmapFont" resources of the game.

    It installs the "BitmapFont" with PixiJS to be used with PIXI.BitmapText.

    -

    Hierarchy

    • PixiBitmapFontManager

    Implements

    Index

    Constructors

    Hierarchy

    • PixiBitmapFontManager

    Implements

    Index

    Constructors

    Methods

    • getDefaultBitmapFont(): BitmapFont

    Returns PixiBitmapFontManager

    Methods

    • getDefaultBitmapFont(): BitmapFont
    • getResourceKinds(): ResourceKind[]
    • getResourceKinds(): ResourceKind[]
    • loadResource(resourceName: string): Promise<void>
    • loadResource(resourceName: string): Promise<void>
    • obtainBitmapFont(bitmapFontResourceName: string, textureAtlasResourceName: string): BitmapFont
    • obtainBitmapFont(bitmapFontResourceName: string, textureAtlasResourceName: string): BitmapFont
    • Given a bitmap font resource name and a texture atlas resource name, returns the PIXI.BitmapFont for it. The font is register and should be released with releaseBitmapFont - so that it can be removed from memory when unused.

      -

      Parameters

      • bitmapFontResourceName: string
      • textureAtlasResourceName: string

      Returns BitmapFont

    • processResource(resourceName: string): Promise<void>
    • processResource(resourceName: string): Promise<void>
    • releaseBitmapFont(bitmapFontInstallKey: string): void
    • releaseBitmapFont(bitmapFontInstallKey: string): void

    Methods

    • getInvalidPIXITexture(): Texture<Resource>
    • getOrCreateDiskTexture(radius: number, pixiRenderer: Renderer): Texture<Resource>
    • getOrCreateDiskTexture(radius: number, pixiRenderer: Renderer): Texture<Resource>
    • getOrCreateRectangleTexture(width: number, height: number, pixiRenderer: Renderer): Texture<Resource>

    Returns Texture<Resource>

    • getOrCreateRectangleTexture(width: number, height: number, pixiRenderer: Renderer): Texture<Resource>
    • Return a texture filled with white.

      Parameters

      • width: number

        The texture width

        @@ -19,7 +19,7 @@

        The texture height

      • pixiRenderer: Renderer

        The renderer used to generate the texture

        -

      Returns Texture<Resource>

    • getOrCreateScaledTexture(imageResourceName: string, width: number, height: number, pixiRenderer: Renderer): Texture<Resource>

    Returns Texture<Resource>

    • getOrCreateScaledTexture(imageResourceName: string, width: number, height: number, pixiRenderer: Renderer): Texture<Resource>
    • Return a texture rescaled according to given dimensions.

      Parameters

      • imageResourceName: string
      • width: number

        The texture width

        @@ -27,7 +27,7 @@

        The texture height

      • pixiRenderer: Renderer

        The renderer used to generate the texture

        -

      Returns Texture<Resource>

    • getOrLoadPIXITexture(resourceName: string): Texture<Resource>

    Returns Texture<Resource>

    • getOrLoadPIXITexture(resourceName: string): Texture<Resource>
    • Return the PIXI texture associated to the specified resource name. If not found in the loaded textures, this method will try to load it. Warning: this method should only be used in specific cases that cannot rely on @@ -35,34 +35,34 @@

      Parameters

      • resourceName: string

        The name of the resource

      Returns Texture<Resource>

      The requested texture, or a placeholder if not valid.

      -
    • getPIXITexture(resourceName: string): Texture<Resource>
    • getPIXITexture(resourceName: string): Texture<Resource>
    • Return the PIXI texture associated to the specified resource name. Returns a placeholder texture if not found.

      Parameters

      • resourceName: string

        The name of the resource

      Returns Texture<Resource>

      The requested texture, or a placeholder if not found.

      -
    • getPIXIVideoTexture(resourceName: string): Texture<Resource>
    • getPIXIVideoTexture(resourceName: string): Texture<Resource>
    • Return the PIXI video texture associated to the specified resource name. Returns a placeholder texture if not found.

      Parameters

      • resourceName: string

        The name of the resource to get.

        -

      Returns Texture<Resource>

    • getResourceKinds(): ResourceKind[]

    Returns Texture<Resource>

    • getResourceKinds(): ResourceKind[]
    • getThreeMaterial(resourceName: string, options: { forceBasicMaterial: boolean; useTransparentTexture: boolean }): Material
    • getThreeMaterial(resourceName: string, options: { forceBasicMaterial: boolean; useTransparentTexture: boolean }): Material
    • Return the three.js material associated to the specified resource name.

      Parameters

      • resourceName: string

        The name of the resource

      • options: { forceBasicMaterial: boolean; useTransparentTexture: boolean }
        • forceBasicMaterial: boolean
        • useTransparentTexture: boolean

      Returns Material

      The requested material.

      -
    • getThreeTexture(resourceName: string): Texture
    • getThreeTexture(resourceName: string): Texture
    • Return the three.js texture associated to the specified resource name. Returns a placeholder texture if not found.

      Parameters

      • resourceName: string

        The name of the resource

      Returns Texture

      The requested texture, or a placeholder if not found.

      -
    • loadResource(resourceName: string): Promise<void>
    • loadResource(resourceName: string): Promise<void>
    • processResource(resourceName: string): Promise<void>
    • processResource(resourceName: string): Promise<void>
    • Process the specified resource.

      This method will only be run while loading screen is shown. It can do heavy tasks like parsing data.

      diff --git a/GDJS Runtime Documentation/classes/gdjs.PlatformObjectsManager.html b/GDJS Runtime Documentation/classes/gdjs.PlatformObjectsManager.html index c49e49ae9..11ee017fb 100644 --- a/GDJS Runtime Documentation/classes/gdjs.PlatformObjectsManager.html +++ b/GDJS Runtime Documentation/classes/gdjs.PlatformObjectsManager.html @@ -3,19 +3,19 @@ platform behavior: in particular, the platforms behaviors are required to declare themselves (see PlatformObjectsManager.addPlatform) to the manager of their associated container (see PlatformRuntimeBehavior.getManager).

      -

    Hierarchy

    • PlatformObjectsManager

    Index

    Methods

    Hierarchy

    • PlatformObjectsManager

    Index

    Methods

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    PlatformRuntimeBehavior represents a behavior allowing objects to be considered as a platform by objects having PlatformerObject Behavior.

    -

    Hierarchy

    Index

    Properties

    JUMPTHRU: number = 1
    LADDER: number = 2
    NORMALPLAFTORM: number = PlatformRuntimeBehavior.NORMALPLATFORM
    deprecated

    Use NORMALPLATFORM instead.

    -
    NORMALPLATFORM: number = 0
    currentRBushAABB: null | BehaviorRBushAABB<PlatformRuntimeBehavior> = null
    name: string
    type: string

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Index

    Properties

    JUMPTHRU: number = 1
    LADDER: number = 2
    NORMALPLAFTORM: number = PlatformRuntimeBehavior.NORMALPLATFORM
    deprecated

    Use NORMALPLATFORM instead.

    +
    NORMALPLATFORM: number = 0
    currentRBushAABB: null | BehaviorRBushAABB<PlatformRuntimeBehavior> = null
    name: string
    type: string

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • canBeGrabbed(): boolean
    • changePlatformType(platformType: string): void
    • canBeGrabbed(): boolean
    • changePlatformType(platformType: string): void
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getPlatformType(): number
    • getYGrabOffset(): number
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getPlatformType(): number
    • getYGrabOffset(): number
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    PlatformerObjectRuntimeBehavior represents a behavior allowing objects to be considered as a platform by objects having PlatformerObject Behavior.

    -

    Hierarchy

    Index

    Methods

    • abortJump(): void

    Hierarchy

    Index

    Methods

    • abortJump(): void
    • activate(enable: boolean): void
    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • canGrabPlatforms(): boolean
    • canGrabPlatforms(): boolean
    • canJump(): boolean
    • canJump(): boolean
    • enableSynchronization(enable: boolean): void
    • getAcceleration(): number
    • enableSynchronization(enable: boolean): void
    • getAcceleration(): number
    • getCurrentFallSpeed(): number
    • getCurrentFallSpeed(): number
    • getCurrentJumpSpeed(): number
    • getCurrentJumpSpeed(): number
    • getCurrentSpeed(): number
    • getCurrentSpeed(): number
    • getDeceleration(): number
    • getDeceleration(): number
    • getGravity(): number
    • getGravity(): number
    • getJumpSpeed(): number
    • getJumpSpeed(): number
    • getJumpSustainTime(): number
    • getJumpSustainTime(): number
    • getLadderClimbingSpeed(): number
    • getLadderClimbingSpeed(): number
    • getMaxFallingSpeed(): number
    • getMaxFallingSpeed(): number
    • getMaxSpeed(): number
    • getMaxSpeed(): number
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getSlopeMaxAngle(): number
    • getSlopeMaxAngle(): number
    • ignoreDefaultControls(ignore: boolean): void
    • ignoreDefaultControls(ignore: boolean): void
    • isFalling(): boolean

    Returns void

    • isFalling(): boolean
    • Check if the Platformer Object is "going down", either because it's in the falling state or because it's jumping but reached the jump peak and is now going down (because the jump speed can't compensate anymore the @@ -75,157 +75,157 @@ the jump is entirely finished and there is no jump speed applied to the object anymore), consider using isFallingWithoutJumping.

      Returns boolean

      Returns true if it is "going down" and false if not.

      -
    • isFallingWithoutJumping(): boolean
    • isFallingWithoutJumping(): boolean
    • isGrabbingPlatform(): boolean
    • isGrabbingPlatform(): boolean
    • isJumping(): boolean
    • isJumping(): boolean
    • isMoving(): boolean
    • isMoving(): boolean
    • isMovingEvenALittle(): boolean
    • isMovingEvenALittle(): boolean
    • isOnFloor(): boolean
    • isOnFloor(): boolean
    • isOnLadder(): boolean
    • isOnLadder(): boolean
    • isSyncedOverNetwork(): boolean
    • isUsingControl(input: string): boolean
    • isSyncedOverNetwork(): boolean
    • isUsingControl(input: string): boolean
    • onActivate(): void
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • setAcceleration(acceleration: number): void
    • setAcceleration(acceleration: number): void
    • setCanGrabPlatforms(enable: boolean): void

    Returns void

    • setCanGrabPlatforms(enable: boolean): void
    • setCanJump(): void

    Returns void

    • setCanJump(): void
    • setCanNotAirJump(): void
    • setCanNotAirJump(): void
    • setCurrentFallSpeed(currentFallSpeed: number): void
    • setCurrentFallSpeed(currentFallSpeed: number): void
    • setCurrentSpeed(currentSpeed: number): void
    • setCurrentSpeed(currentSpeed: number): void
    • setDeceleration(deceleration: number): void

    Returns void

    • setDeceleration(deceleration: number): void
    • setGravity(gravity: number): void

    Returns void

    • setGravity(gravity: number): void
    • setJumpSpeed(jumpSpeed: number): void

    Returns void

    • setJumpSpeed(jumpSpeed: number): void
    • setJumpSustainTime(jumpSustainTime: number): void

    Returns void

    • setJumpSustainTime(jumpSustainTime: number): void
    • setLadderClimbingSpeed(ladderClimbingSpeed: number): void
    • setLadderClimbingSpeed(ladderClimbingSpeed: number): void
    • setMaxFallingSpeed(maxFallingSpeed: number, tryToPreserveAirSpeed?: boolean): void

    Returns void

    • setMaxFallingSpeed(maxFallingSpeed: number, tryToPreserveAirSpeed?: boolean): void
    • Set the maximum falling speed of the Platformer Object.

      Parameters

      • maxFallingSpeed: number

        The maximum falling speed.

      • tryToPreserveAirSpeed: boolean = false

        If true and if jumping, tune the current jump speed to preserve the overall speed in the air.

        -

      Returns void

    • setMaxSpeed(maxSpeed: number): void

    Returns void

    • setMaxSpeed(maxSpeed: number): void
    • setSlopeMaxAngle(slopeMaxAngle: number): void

    Returns void

    • setSlopeMaxAngle(slopeMaxAngle: number): void
    • shouldIgnoreDefaultControls(): boolean

    Returns void

    • shouldIgnoreDefaultControls(): boolean
    • simulateControl(input: string): void
    • simulateControl(input: string): void
    • simulateDownKey(): void

    Returns void

    • simulateDownKey(): void
    • simulateJumpKey(): void
    • simulateJumpKey(): void
    • simulateLadderKey(): void
    • simulateLadderKey(): void
    • simulateLeftKey(): void
    • simulateLeftKey(): void
    • simulateReleaseLadderKey(): void
    • simulateReleaseLadderKey(): void
    • simulateReleasePlatformKey(): void
    • simulateReleasePlatformKey(): void
    • simulateRightKey(): void
    • simulateRightKey(): void
    • simulateUpKey(): void
    • simulateUpKey(): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • usesLifecycleFunction(): boolean
    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    name: string
    type: string
    epsilon: number = ...
    +

    Returns boolean

    Constructors

    Properties

    name: string
    type: string
    epsilon: number = ...

    A very small value compare to 1 pixel, yet very huge compare to rounding errors.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Polygon represents a polygon which can be used to create collisions masks for RuntimeObject.

    -

    Hierarchy

    • Polygon

    Index

    Properties

    center: FloatPoint = ...
    +

    Hierarchy

    • Polygon

    Index

    Properties

    center: FloatPoint = ...

    The center of the polygon. This property is only valid after calling computeCenter, and remains valid until vertices are modified.

    -
    edges: FloatPoint[] = []
    +
    edges: FloatPoint[] = []

    The edges of the polygon. This property is only valid after calling computeEdges, and remains valid until vertices are modified.

    -
    makeNewCollisionTestResult: () => CollisionTestResult = makeNewCollisionTestResult

    Type declaration

    makeNewCollisionTestResult: () => CollisionTestResult = makeNewCollisionTestResult

    Type declaration

    makeNewRaycastTestResult: () => RaycastTestResult = makeNewRaycastTestResult

    Type declaration

    makeNewRaycastTestResult: () => RaycastTestResult = makeNewRaycastTestResult

    Type declaration

    vertices: FloatPoint[] = []
    +

    Returns RaycastTestResult

    vertices: FloatPoint[] = []

    The vertices of the polygon

    -

    Methods

    Methods

    • Do a collision test between two polygons. Please note that polygons must convexes!

      You can read the result but do not keep a reference to it as it's a static object @@ -27,15 +27,15 @@

    • ignoreTouchingEdges: boolean

      If true, then edges that are touching each other, without the polygons actually overlapping, won't be considered in collision.

    Returns CollisionTestResult

    A collision result. collision property is equal to true if polygons are overlapping. Do NOT keep a reference to this.

    -
    • computeCenter(): FloatPoint
    • computeEdges(): void
    • computeCenter(): FloatPoint
    • computeEdges(): void
    • createRectangle(width: number, height: number): Polygon
    • crossProduct(a: FloatPoint, b: FloatPoint): number
    • distance(minA: number, maxA: number, minB: number, maxB: number): number
    • dotProduct(a: FloatPoint, b: FloatPoint): number
    • isConvex(): boolean
    • isPointInside(poly: Polygon, x: number, y: number): boolean
    • createRectangle(width: number, height: number): Polygon
    • crossProduct(a: FloatPoint, b: FloatPoint): number
    • distance(minA: number, maxA: number, minB: number, maxB: number): number
    • dotProduct(a: FloatPoint, b: FloatPoint): number
    • isConvex(): boolean
    • isPointInside(poly: Polygon, x: number, y: number): boolean
    • Check if a point is inside a polygon.

      Uses PNPOLY by W. Randolph Franklin.

      Parameters

      • poly: Polygon
        @@ -45,7 +45,7 @@
      • y: number

        The point y coordinate

      Returns boolean

      true if the point is inside the polygon

      -
    • move(x: number, y: number): void
    • normalise(v: FloatPoint): void
    • project(axis: FloatPoint, p: Polygon, result: FloatPoint): void
    • move(x: number, y: number): void
    • normalise(v: FloatPoint): void
    • project(axis: FloatPoint, p: Polygon, result: FloatPoint): void
    • Do a raycast test. Please note that the polygon must be convex!

      You can read the result but do not keep a reference to it as it's a static object @@ -62,7 +62,7 @@

    • endY: number

      The raycast end point Y

    Returns RaycastTestResult

    A raycast result with the contact points and distances. Do NOT keep a reference to this.

    -
    • rotate(angle: number): void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A basic profiling tool that can be used to measure time spent in sections of the engine.

    -

    Hierarchy

    • Profiler

    Index

    Methods

    • begin(sectionName: string): void
    • beginFrame(): void
    • end(sectionName?: string): void
    • endFrame(): void

    Hierarchy

    • Profiler

    Index

    Methods

    • begin(sectionName: string): void
    • beginFrame(): void
    • end(sectionName?: string): void
    • endFrame(): void
    • getProfilerSectionTexts(sectionName: string, profilerSection: any, outputs: any): void
    • getProfilerSectionTexts(sectionName: string, profilerSection: any, outputs: any): void
    • Convert measures for a section into texts. Useful for ingame profiling.

      Parameters

      • sectionName: string
        @@ -12,9 +12,9 @@

        The section measures

      • outputs: any

        The array where to push the results

        -

      Returns void

    Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A task that resolves with a promise.

    -

    Type parameters

    • ResultType = void

    Hierarchy

    Index

    Constructors

    Properties

    Methods

    Constructors

    • new PromiseTask<ResultType>(promise: Promise<ResultType>): PromiseTask<ResultType>

    Properties

    promise: Promise<ResultType>
    isResolved: boolean = false

    Methods

    • update(): boolean

    Type parameters

    • ResultType = void

    Hierarchy

    Index

    Constructors

    Properties

    Methods

    Constructors

    • new PromiseTask<ResultType>(promise: Promise<ResultType>): PromiseTask<ResultType>

    Properties

    promise: Promise<ResultType>
    isResolved: boolean = false

    Methods

    • update(): boolean

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A behavior that forwards the Resizable interface to its object.

    -

    Hierarchy

    Implements

    Index

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • enableSynchronization(enable: boolean): void
    • getHeight(): number
    • enableSynchronization(enable: boolean): void
    • getHeight(): number
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getWidth(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getWidth(): number
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • setHeight(newHeight: number): void
    • setHeight(newHeight: number): void
    • setSize(newWidth: number, newHeight: number): void
    • setSize(newWidth: number, newHeight: number): void
    • setWidth(newWidth: number): void
    • setWidth(newWidth: number): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Methods

    Constructors

    Methods

    • update(): boolean
    • +ResolveTask | GDevelop JavaScript game engine
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Legend

      • Method
      • Inherited constructor

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      A cache of resources that helps ensuring that files are only downloaded once.

      -

      Type parameters

      • C

      Hierarchy

      • ResourceCache

      Index

      Methods

      • clear(): void
      • delete(resource: ResourceData): void
      • get(resource: ResourceData): null | C
      • getFromName(name: string): null | C

      Type parameters

      • C

      Hierarchy

      • ResourceCache

      Index

      Methods

      • clear(): void
      • delete(resource: ResourceData): void
      • get(resource: ResourceData): null | C
      • getFromName(name: string): null | C
      • Gives a fast access to asset content when they were pre-loaded and on-the-fly loading is not allowed.

        -

        Parameters

        • name: string

        Returns null | C

      • set(resource: ResourceData, content: C): void

      Constructors

      Legend

      • Method

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

    Hierarchy

    • ResourceLoader

    Index

    Methods

    • areSceneAssetsLoaded(sceneName: string): boolean
    • Parameters

      • sceneName: string

      Returns boolean

      true when all the resources of the given scene are loaded (but maybe not parsed).

      -
    • areSceneAssetsReady(sceneName: string): boolean
    • areSceneAssetsReady(sceneName: string): boolean
    • checkIfCredentialsRequired(url: string): boolean
    • checkIfCredentialsRequired(url: string): boolean
    • Return true if the specified URL must be loaded with cookies ("credentials") sent to grant access to them.

      -

      Parameters

      • url: string

      Returns boolean

    • getFullUrl(url: string): string
    • getFullUrl(url: string): string
    • Complete the given URL with any specific parameter required to access the resource (this can be for example a token needed to access the resource).

      -

      Parameters

      • url: string

      Returns string

    • getResource(resourceName: string): null | ResourceData
    • getSceneLoadingProgress(sceneName: string): number
    • getResource(resourceName: string): null | ResourceData
    • getSceneLoadingProgress(sceneName: string): number
    • loadAllResources(onProgress: (loadingCount: number, totalCount: number) => void): Promise<void>
    • Parameters

      • onProgress: (loadingCount: number, totalCount: number) => void
          • (loadingCount: number, totalCount: number): void
          • Parameters

            • loadingCount: number
            • totalCount: number

            Returns void

      Returns Promise<void>

    • loadAllSceneInBackground(): Promise<void>
    • loadAllResources(onProgress: (loadingCount: number, totalCount: number) => void): Promise<void>
    • Parameters

      • onProgress: (loadingCount: number, totalCount: number) => void
          • (loadingCount: number, totalCount: number): void
          • Parameters

            • loadingCount: number
            • totalCount: number

            Returns void

      Returns Promise<void>

    • loadAllSceneInBackground(): Promise<void>
    • Load each scene in order.

      This is done in background to try to avoid loading screens when changing scenes.

      -

      Returns Promise<void>

    • loadAndProcessSceneResources(sceneName: string, onProgress?: (count: number, total: number) => Promise<void>): Promise<void>
    • loadAndProcessSceneResources(sceneName: string, onProgress?: (count: number, total: number) => Promise<void>): Promise<void>
    • Load and process a scene that is needed right away.

      The renderer will show a loading screen while its done.

      -

      Parameters

      • sceneName: string
      • Optional onProgress: (count: number, total: number) => Promise<void>
          • (count: number, total: number): Promise<void>
          • Parameters

            • count: number
            • total: number

            Returns Promise<void>

      Returns Promise<void>

    • loadGlobalAndFirstSceneResources(firstSceneName: string, onProgress: (count: number, total: number) => void): Promise<void>
    • +

      Parameters

      • sceneName: string
      • Optional onProgress: (count: number, total: number) => Promise<void>
          • (count: number, total: number): Promise<void>
          • Parameters

            • count: number
            • total: number

            Returns Promise<void>

      Returns Promise<void>

    • loadGlobalAndFirstSceneResources(firstSceneName: string, onProgress: (count: number, total: number) => void): Promise<void>
    • Load the resources that are needed to launch the first scene.

      -

      Parameters

      • firstSceneName: string
      • onProgress: (count: number, total: number) => void
          • (count: number, total: number): void
          • Parameters

            • count: number
            • total: number

            Returns void

      Returns Promise<void>

    • loadSceneResources(sceneName: string, onProgress?: (count: number, total: number) => void): Promise<void>
    • +

      Parameters

      • firstSceneName: string
      • onProgress: (count: number, total: number) => void
          • (count: number, total: number): void
          • Parameters

            • count: number
            • total: number

            Returns void

      Returns Promise<void>

    • loadSceneResources(sceneName: string, onProgress?: (count: number, total: number) => void): Promise<void>
    • Load a scene resources without parsing them.

      When another scene resources are loading in background, it waits for all its resources to be loaded before loading resources of the given scene.

      -

      Parameters

      • sceneName: string
      • Optional onProgress: (count: number, total: number) => void
          • (count: number, total: number): void
          • Parameters

            • count: number
            • total: number

            Returns void

      Returns Promise<void>

    • setResources(resourceDataArray: ResourceData[], globalResources: string[], layoutDataArray: LayoutData[]): void
    • +

      Parameters

      • sceneName: string
      • Optional onProgress: (count: number, total: number) => void
          • (count: number, total: number): void
          • Parameters

            • count: number
            • total: number

            Returns void

      Returns Promise<void>

    • setResources(resourceDataArray: ResourceData[], globalResources: string[], layoutDataArray: LayoutData[]): void
    • Update the resources data of the game. Useful for hot-reloading, should not be used otherwise.

      -

      Parameters

      • resourceDataArray: ResourceData[]
      • globalResources: string[]
      • layoutDataArray: LayoutData[]

      Returns void

    Constructors

    • new ResourceLoader(runtimeGame: RuntimeGame, resourceDataArray: ResourceData[], globalResources: string[], layoutDataArray: LayoutData[]): ResourceLoader

    Constructors

    • new ResourceLoader(runtimeGame: RuntimeGame, resourceDataArray: ResourceData[], globalResources: string[], layoutDataArray: LayoutData[]): ResourceLoader
    • Parameters

      • runtimeGame: RuntimeGame

        The game.

      • resourceDataArray: ResourceData[]

        The resources data of the game.

        @@ -64,9 +64,9 @@

        The resources needed for any layer.

      • layoutDataArray: LayoutData[]

        The resources used by each layer.

        -

      Returns ResourceLoader

    Properties

    currentLoadingSceneName: string = ''
    +

    Returns ResourceLoader

    Properties

    currentLoadingSceneName: string = ''

    Only used by events.

    -
    currentSceneLoadingProgress: number = 0
    +
    currentSceneLoadingProgress: number = 0

    Only used by events.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    RuntimeBehavior represents a behavior being used by a RuntimeObject.

    -

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean

    Returns void

    • enableSynchronization(enable: boolean): void
    • getName(): string

    Returns void

    • enableSynchronization(enable: boolean): void
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • Reimplement this method to do extra work when the behavior is activated (after it has been deactivated, see onDeActivate).

      -

      Returns void

    • onCreated(): void
    • onCreated(): void
    • 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(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • 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

    • Called at each frame after events. Call doStepPostEvents.
      Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.

      Parameters

      Returns void

    Returns void

    • Called at each frame before events. Call doStepPreEvents.
      Behaviors writers: Please do not redefine this method. Redefine doStepPreEvents instead.

      Parameters

      Returns void

    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean
    • Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.

      see

      gdjs.RuntimeBehavior#onObjectHotReloaded

      @@ -58,24 +58,24 @@
  • newBehaviorData: BehaviorData

    The new data for the behavior.

  • Returns boolean

    true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

    -
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • Update the behavior properties using the provided data.

      Parameters

      • networkSyncData: BehaviorNetworkSyncData

        The new properties of the behavior.

        -

      Returns void

    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Represents a layer of a custom object. It doesn't allow to move any camera because it doesn't make sense inside an object.

    -

    Hierarchy

    Index

    Methods

    • addEffect(effectData: EffectData): void

    Hierarchy

    Index

    Methods

    • addEffect(effectData: EffectData): void
    • applyLayerInverseTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint

    Returns void

    • applyLayerInverseTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • applyLayerTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • applyLayerTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • convertCoords(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • convertCoords(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • convertInverseCoords(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • convertInverseCoords(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • followBaseLayer(): void

    Returns void

    • followBaseLayer(): void
    • get3DRendererObject(): null | Scene
    • getCameraHeight(cameraId?: number): number
    • get3DRendererObject(): null | Scene
    • getCameraHeight(cameraId?: number): number
    • getCameraRotation(cameraId?: number): number
    • getCameraRotation(cameraId?: number): number
    • getCameraWidth(cameraId?: number): number
    • getCameraWidth(cameraId?: number): number
    • getCameraX(cameraId?: number): number
    • getCameraX(cameraId?: number): number
    • getCameraY(cameraId?: number): number
    • getCameraY(cameraId?: number): number
    • getCameraZ(fov: null | number, cameraId?: number): number
    • getCameraZ(fov: null | number, cameraId?: number): number
    • getCameraZoom(cameraId?: number): number
    • getCameraZoom(cameraId?: number): number
    • getClearColor(): number[]
    • getClearColor(): number[]
    • getDefaultZOrder(): number
    • getDefaultZOrder(): number
    • getHeight(): number
    • getInitialCamera3DFarPlaneDistance(): number
    • getInitialCamera3DFieldOfView(): number
    • getInitialCamera3DNearPlaneDistance(): number
    • getInitialEffectsData(): EffectData[]

    Returns number

    • getHeight(): number
    • getInitialCamera3DFarPlaneDistance(): number
    • getInitialCamera3DFieldOfView(): number
    • getInitialCamera3DNearPlaneDistance(): number
    • getInitialEffectsData(): EffectData[]
    • getName(): string
    • getName(): string
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Container<DisplayObject>
    • getRendererObject(): Container<DisplayObject>
    • getTimeScale(): number
    • getTimeScale(): number
    • getWidth(): number
    • hasEffect(name: string): boolean
    • getWidth(): number
    • hasEffect(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isLightingLayer(): boolean
    • isLightingLayer(): boolean
    • isVisible(): boolean
    • isVisible(): boolean
    • onGameResolutionResized(oldGameResolutionOriginX: number, oldGameResolutionOriginY: number): void
    • onGameResolutionResized(oldGameResolutionOriginX: number, oldGameResolutionOriginY: number): void
    • removeEffect(effectName: string): void
    • removeEffect(effectName: string): void
    • setCameraRotation(rotation: number, cameraId?: number): void

    Returns void

    • setCameraRotation(rotation: number, cameraId?: number): void
    • setCameraX(x: number, cameraId?: number): void
    • setCameraX(x: number, cameraId?: number): void
    • setCameraY(y: number, cameraId?: number): void
    • setCameraY(y: number, cameraId?: number): void
    • setCameraZ(z: number, fov: number, cameraId?: number): void
    • setCameraZ(z: number, fov: number, cameraId?: number): void
    • setCameraZoom(newZoom: number, cameraId?: number): void
    • setCameraZoom(newZoom: number, cameraId?: number): void
    • setClearColor(r: number, g: number, b: number): void
    • setClearColor(r: number, g: number, b: number): void
    • Set the clear color in format [r, g, b], with components in the range of 0 to 1.;

      Parameters

      • r: number

        Red color component in the range 0-255.

        @@ -118,11 +118,11 @@

        Green color component in the range 0-255.

      • b: number

        Blue color component in the range 0-255.

        -

      Returns void

    • setDefaultZOrder(defaultZOrder: number): void

    Returns void

    • setDefaultZOrder(defaultZOrder: number): void
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): void

    Returns void

    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): void
    • setEffectDoubleParameter(name: string, parameterName: string, value: number): void

    Returns void

    • setEffectDoubleParameter(name: string, parameterName: string, value: number): void
    • setEffectStringParameter(name: string, parameterName: string, value: string): void

    Returns void

    • setEffectStringParameter(name: string, parameterName: string, value: string): void
    • setFollowBaseLayerCamera(follow: boolean): void

    Returns void

    • setFollowBaseLayerCamera(follow: boolean): void
    • setTimeScale(timeScale: number): void
    • setTimeScale(timeScale: number): void
    • show(enable: boolean): void

    Returns void

    • show(enable: boolean): void

    Returns void

    Constructors

    Constructors

    Hierarchy

    • RuntimeGame

    Index

    Methods

    • areSceneAssetsLoaded(sceneName: string): boolean
    • Parameters

      • sceneName: string

      Returns boolean

      true when all the resources of the given scene are loaded (but maybe not parsed).

      -
    • areSceneAssetsReady(sceneName: string): boolean
    • areSceneAssetsReady(sceneName: string): boolean
    • Parameters

      • sceneName: string

      Returns boolean

      true when all the resources of the given scene are loaded and parsed.

      -
    • enableMetrics(enable: boolean): void
    • enableMetrics(enable: boolean): void
    • getAdaptGameResolutionAtRuntime(): boolean
    • getAdaptGameResolutionAtRuntime(): boolean
    • Returns if the game resolution should be automatically adapted when the game window or screen size change. This will only be the case if the game resolution resize mode is configured to adapt the width or the height of the game.

      Returns boolean

      true if the game resolution is automatically changed according to the window/screen size.

      -
    • getAntialiasingMode(): "none" | "MSAA"
    • getAntialiasingMode(): "none" | "MSAA"
    • getEffectsManager(): PixiEffectsManager
    • getEffectsManager(): PixiEffectsManager
    • Get the effects manager of the game, which allows to manage effects on runtime objects or runtime layers.

      Returns PixiEffectsManager

      The effects manager for the game

      -
    • getEmbeddedResourcesNames(resourceName: string): string[]
    • getEmbeddedResourcesNames(resourceName: string): string[]
    • Returns the array of resources that are embedded to passed one.

      Parameters

      • resourceName: string

        The name of resource to find embedded resources of.

      Returns string[]

      The array of related resources names.

      -
    • getEventsBasedObjectData(type: string): null | EventsBasedObjectData
    • getExtensionProperty(extensionName: string, propertyName: string): null | string
    • getEventsBasedObjectData(type: string): null | EventsBasedObjectData
    • getExtensionProperty(extensionName: string, propertyName: string): null | string
    • Gets an extension property from the project data.

      Parameters

      • extensionName: string

        The extension name.

      • propertyName: string

        The property name.

      Returns null | string

      The property value.

      -
    • getExternalLayoutData(name: string): null | ExternalLayoutData
    • getExternalLayoutData(name: string): null | ExternalLayoutData
    • Get the data associated to an external layout.

      Parameters

      • name: string

        The name of the external layout.

      Returns null | ExternalLayoutData

      The data associated to the external layout or null if not found.

      -
    • getGameData(): ProjectData
    • getGameData(): ProjectData
    • getGameResolutionHeight(): number
    • getGameResolutionHeight(): number
    • Get the game resolution (the size at which the game is played and rendered) height.

      Returns number

      The game resolution height, in pixels.

      -
    • getGameResolutionResizeMode(): string
    • getGameResolutionResizeMode(): string
    • Returns if the width or the height of the game resolution should be changed to fit the game window - or if the game resolution should not be updated automatically (empty string).

      Returns string

      Either "" (don't change game resolution), "adaptWidth" or "adaptHeight".

      -
    • getGameResolutionWidth(): number
    • getGameResolutionWidth(): number
    • Get the game resolution (the size at which the game is played and rendered) width.

      Returns number

      The game resolution width, in pixels.

      -
    • getInitialObjectsData(): ObjectData[]
    • getInitialObjectsData(): ObjectData[]
    • Get the data representing all the global objects of the game.

      Returns ObjectData[]

      The data associated to the global objects.

      -
    • getMinimalFramerate(): number
    • getMinimalFramerate(): number
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): null | GameNetworkSyncData
    • getOriginalHeight(): number
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): null | GameNetworkSyncData
    • getOriginalHeight(): number
    • Get the original height of the game, as set on the startup of the game.

      This is guaranteed to never change, even if the size of the game is changed afterwards.

      -

      Returns number

    • getOriginalWidth(): number
    • getOriginalWidth(): number
    • Get the original width of the game, as set on the startup of the game.

      This is guaranteed to never change, even if the size of the game is changed afterwards.

      -

      Returns number

    • getPixelsRounding(): boolean
    • getPixelsRounding(): boolean
    • getPlatformInfo(): { devicePlatform: any; hasTouch: boolean; isCordova: boolean; navigatorPlatform: string; supportedCompressionMethods: ("cs:gzip" | "cs:deflate")[] }
    • getPlatformInfo(): { devicePlatform: any; hasTouch: boolean; isCordova: boolean; navigatorPlatform: string; supportedCompressionMethods: ("cs:gzip" | "cs:deflate")[] }
    • Helper function to get information about the platform running the game.

      -

      Returns { devicePlatform: any; hasTouch: boolean; isCordova: boolean; navigatorPlatform: string; supportedCompressionMethods: ("cs:gzip" | "cs:deflate")[] }

      • devicePlatform: any
      • hasTouch: boolean
      • isCordova: boolean
      • navigatorPlatform: string
      • supportedCompressionMethods: ("cs:gzip" | "cs:deflate")[]
    • getPlayerId(): null | string
    • getScaleMode(): "linear" | "nearest"
    • +

      Returns { devicePlatform: any; hasTouch: boolean; isCordova: boolean; navigatorPlatform: string; supportedCompressionMethods: ("cs:gzip" | "cs:deflate")[] }

      • devicePlatform: any
      • hasTouch: boolean
      • isCordova: boolean
      • navigatorPlatform: string
      • supportedCompressionMethods: ("cs:gzip" | "cs:deflate")[]
    • getPlayerId(): null | string
    • getScaleMode(): "linear" | "nearest"
    • getSceneAndExtensionsData(sceneName?: string): null | SceneAndExtensionsData
    • getSceneAndExtensionsData(sceneName?: string): null | SceneAndExtensionsData
    • Get the data associated to a scene.

      Parameters

      • Optional sceneName: string

        The name of the scene. If not defined, the first scene will be returned.

      Returns null | SceneAndExtensionsData

      The data associated to the scene.

      -
    • getSceneLoadingProgress(sceneName: string): number
    • getSceneLoadingProgress(sceneName: string): number
    • Parameters

      • sceneName: string

      Returns number

      The progress of assets loading in background for a scene (between 0 and 1).

      -
    • getSessionId(): null | string
    • getSessionId(): null | string
    • hasJustResumed(): boolean
    • hasJustResumed(): boolean
    • Returns boolean

      true during the first frame the game is back from being hidden. This has nothing to do with _paused.

      -
    • hasScene(sceneName?: string): boolean
    • hasScene(sceneName?: string): boolean
    • Check if a scene exists

      Parameters

      • Optional sceneName: string

        The name of the scene to search.

      Returns boolean

      true if the scene exists. If sceneName is undefined, true if the game has a scene.

      -
    • isAntialisingEnabledOnMobile(): boolean
    • isAntialisingEnabledOnMobile(): boolean
    • isPreview(): boolean
    • isPreview(): boolean
    • Check if the game is running as a preview, launched from an editor.

      Returns boolean

      true if the current game is a preview.

      -
    • isUsingGDevelopDevelopmentEnvironment(): boolean
    • isUsingGDevelopDevelopmentEnvironment(): boolean
    • Check if the game should call GDevelop development APIs or not.

      Unless you are contributing to GDevelop, avoid using this.

      -

      Returns boolean

    • loadAllAssets(callback: () => void, progressCallback?: (progress: number) => void): void
    • loadAllAssets(callback: () => void, progressCallback?: (progress: number) => void): void
    • Load all assets needed to display the 1st scene, displaying progress in renderer.

      -

      Parameters

      • callback: () => void
          • (): void
          • Returns void

      • Optional progressCallback: (progress: number) => void
          • (progress: number): void
          • Parameters

            • progress: number

            Returns void

      Returns void

    • loadFirstAssetsAndStartBackgroundLoading(firstSceneName: string, progressCallback?: (progress: number) => void): Promise<void>
    • +

      Parameters

      • callback: () => void
          • (): void
          • Returns void

      • Optional progressCallback: (progress: number) => void
          • (progress: number): void
          • Parameters

            • progress: number

            Returns void

      Returns void

    • loadFirstAssetsAndStartBackgroundLoading(firstSceneName: string, progressCallback?: (progress: number) => void): Promise<void>
    • Load all assets needed to display the 1st scene, displaying progress in renderer.

      When a game is hot-reload, this method can be called with the current scene.

      -

      Parameters

      • firstSceneName: string
      • Optional progressCallback: (progress: number) => void
          • (progress: number): void
          • Parameters

            • progress: number

            Returns void

      Returns Promise<void>

    • loadSceneAssets(sceneName: string, progressCallback?: (progress: number) => void): Promise<void>
    • +

      Parameters

      • firstSceneName: string
      • Optional progressCallback: (progress: number) => void
          • (progress: number): void
          • Parameters

            • progress: number

            Returns void

      Returns Promise<void>

    • loadSceneAssets(sceneName: string, progressCallback?: (progress: number) => void): Promise<void>
    • Load all assets for a given scene, displaying progress in renderer.

      -

      Parameters

      • sceneName: string
      • Optional progressCallback: (progress: number) => void
          • (progress: number): void
          • Parameters

            • progress: number

            Returns void

      Returns Promise<void>

    • onWindowInnerSizeChanged(): void
    • +

      Parameters

      • sceneName: string
      • Optional progressCallback: (progress: number) => void
          • (progress: number): void
          • Parameters

            • progress: number

            Returns void

      Returns Promise<void>

    • onWindowInnerSizeChanged(): void
    • Called by the game renderer when the window containing the game has changed size (this can result from a resize of the window, but also other factors like a device orientation change on mobile).

      -

      Returns void

    • pause(enable: boolean): void
    • pause(enable: boolean): void
    • Set or unset the game as paused. When paused, the game won't step and will be freezed. Useful for debugging.

      Parameters

      • enable: boolean

        true to pause the game, false to unpause

        -

      Returns void

    • prioritizeLoadingOfScene(sceneName: string): void

    Returns void

    • prioritizeLoadingOfScene(sceneName: string): void
    • resolveEmbeddedResource(mainResourceName: string, embeddedResourceName: string): string
    • resolveEmbeddedResource(mainResourceName: string, embeddedResourceName: string): string
    • Resolves the name of an embedded resource.

      Parameters

      • mainResourceName: string

        The name of the resource containing the embedded resource.

      • embeddedResourceName: string

        The name of the embedded resource.

      Returns string

      The resource name.

      -
    • setAdaptGameResolutionAtRuntime(enable: boolean): void
    • setAdaptGameResolutionAtRuntime(enable: boolean): void
    • Set if the game resolution should be automatically adapted when the game window or screen size change. This will only be the case if the game resolution resize mode is configured to adapt the width or the height of the game.

      Parameters

      • enable: boolean

        true to change the game resolution according to the window/screen size.

        -

      Returns void

    • setGameResolutionResizeMode(resizeMode: string): void

    Returns void

    • setGameResolutionResizeMode(resizeMode: string): void
    • Set if the width or the height of the game resolution should be changed to fit the game window - or if the game resolution should not be updated automatically.

      Parameters

      • resizeMode: string

        Either "" (don't change game resolution), "adaptWidth" or "adaptHeight".

        -

      Returns void

    • setGameResolutionSize(width: number, height: number): void

    Returns void

    • setGameResolutionSize(width: number, height: number): void
    • setProjectData(projectData: ProjectData): void

    Returns void

    • setProjectData(projectData: ProjectData): void
    • Update the project data. Useful for hot-reloading, should not be used otherwise.

      Parameters

      • projectData: ProjectData

        The object (usually stored in data.json) containing the full project data

        -

      Returns void

    • startCurrentSceneProfiler(onProfilerStopped: (oldProfiler: Profiler) => void): boolean

    Returns void

    • startCurrentSceneProfiler(onProfilerStopped: (oldProfiler: Profiler) => void): boolean
    • Start a profiler for the currently running scene.

      Parameters

      • onProfilerStopped: (oldProfiler: Profiler) => void

        Function to be called when the profiler is stopped. Will be passed the profiler as argument.

        -

      Returns boolean

    • startGameLoop(): void

    Returns boolean

    • startGameLoop(): void
    • stopCurrentSceneProfiler(): void
    • stopCurrentSceneProfiler(): void
    • updateFromNetworkSyncData(syncData: GameNetworkSyncData): void
    • wasFirstSceneLoaded(): boolean
    • updateFromNetworkSyncData(syncData: GameNetworkSyncData): void
    • wasFirstSceneLoaded(): boolean

    Constructors

    Constructors

    Properties

    inventories: {}

    Type declaration

    shopifyClients: {}

    Type declaration

    • [name: string]: any

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The renderer for a gdjs.RuntimeGame using Pixi.js.

    -

    Hierarchy

    • RuntimeGamePixiRenderer

    Index

    Methods

    • bindStandardEvents(manager: InputManager, window: Window, document: Document): void

    Hierarchy

    • RuntimeGamePixiRenderer

    Index

    Methods

    • bindStandardEvents(manager: InputManager, window: Window, document: Document): void
    • centerWindow(): void
    • centerWindow(): void
    • convertCanvasToDomElementContainerCoords(canvasCoords: FloatPoint, result: FloatPoint): FloatPoint
    • convertCanvasToDomElementContainerCoords(canvasCoords: FloatPoint, result: FloatPoint): FloatPoint
    • Convert a point from the canvas coordinates to the dom element container coordinates.

      Parameters

      • canvasCoords: FloatPoint

        The point in the canvas coordinates.

      • result: FloatPoint

        The point to return.

      Returns FloatPoint

      The point in the dom element container coordinates.

      -
    • createStandardCanvas(parentElement: HTMLElement): void
    • createStandardCanvas(parentElement: HTMLElement): void
    • getCanvas(): null | HTMLCanvasElement
    • getCanvas(): null | HTMLCanvasElement
    • getCanvasToDomElementContainerHeightScale(): number
    • getCanvasToDomElementContainerHeightScale(): number
    • Return the scale factor between the renderer height and the actual canvas height, which is also the height of the container for DOM elements to be superimposed on top of it.

      Useful to scale font sizes of DOM elements so that they follow the size of the game.

      -

      Returns number

    • getDomElementContainer(): null | HTMLDivElement
    • getDomElementContainer(): null | HTMLDivElement
    • getElectron(): any
    • getElectron(): any
    • getElectronRemote(): any
    • getElectronRemote(): any
    • getPIXIRenderer(): null | Renderer
    • getThreeRenderer(): null | WebGLRenderer
    • getPIXIRenderer(): null | Renderer
    • getThreeRenderer(): null | WebGLRenderer
    • getWindowInnerHeight(): number
    • getWindowInnerWidth(): number
    • getWindowTitle(): string
    • isFullScreen(): boolean
    • getWindowInnerHeight(): number
    • getWindowInnerWidth(): number
    • getWindowTitle(): string
    • isFullScreen(): boolean
    • isWebGLSupported(): boolean
    • isWebGLSupported(): boolean
    • keepAspectRatio(enable: any): void
    • keepAspectRatio(enable: any): void
    • openURL(url: string): void
    • openURL(url: string): void
    • setFullScreen(enable: any): void
    • setFullScreen(enable: any): void
    • setMargins(top: any, right: any, bottom: any, left: any): void
    • setMargins(top: any, right: any, bottom: any, left: any): void
    • setWindowSize(width: number, height: number): void
    • setWindowSize(width: number, height: number): void
    • setWindowTitle(title: any): void
    • startGameLoop(fn: any): void
    • stopGame(): void

    Returns void

    • setWindowTitle(title: any): void
    • startGameLoop(fn: any): void
    • stopGame(): void
    • updateRendererSize(): void
    • updateRendererSize(): void
    • Update the game renderer size according to the "game resolution". Called when game resolution changes.

      Note that if the canvas is fullscreen, it won't be resized, but when going back to non fullscreen mode, the requested size will be used.

      -

      Returns void

    Constructors

    Constructors

    • convertCoords(x: number, y: number, result?: FloatPoint): FloatPoint

    Returns void

    • convertCoords(x: number, y: number, result?: FloatPoint): FloatPoint
    • Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.

      Parameters

      • x: number
        @@ -17,7 +17,7 @@

        The y position, in container coordinates.

      • Optional result: FloatPoint

        The point instance that is used to return the result.

        -

      Returns FloatPoint

    • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint

    Returns FloatPoint

    • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint
    • Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.

      Parameters

      • sceneX: number
        @@ -26,13 +26,13 @@

        The y position, in container coordinates.

      • result: FloatPoint

        The point instance that is used to return the result.

        -

      Returns FloatPoint

    Returns FloatPoint

    • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, zPos: number, trackByPersistentUuid: boolean): void
    • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, zPos: number, trackByPersistentUuid: boolean): void
    • Create objects from initial instances data (for example, the initial instances of the scene or the instances of an external layout).

      Parameters

      • data: InstanceData[]
        @@ -46,121 +46,121 @@
      • trackByPersistentUuid: boolean

        If true, objects are tracked by setting their persistentUuid to the same as the associated instance. Useful for hot-reloading when instances are changed.

        -

      Returns void

    • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void

    Returns void

    • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void
    • Activate or deactivate the debug visualization for collisions and points.

      -

      Parameters

      • enableDebugDraw: boolean
      • showHiddenInstances: boolean
      • showPointsNames: boolean
      • showCustomPoints: boolean

      Returns void

    • getAllLayerNames(result: string[]): void
    • getAllLayerNames(result: string[]): void

    Returns void

    • getElapsedTime(): number
    • getElapsedTime(): number
    • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
    • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
    • Get the data representing the initial shared data of the scene for the specified behavior.

      Parameters

      • name: string

        The name of the behavior

      Returns null | BehaviorSharedData

      The shared data for the behavior, if any.

      -
    • getInstancesCountOnScene(objectName: string): number
    • getInstancesCountOnScene(objectName: string): number
    • Return the number of instances of the specified object living in the container.

      Parameters

      • objectName: string

        The object name for which instances must be counted.

        -

      Returns number

    • getViewportHeight(): number

    Returns RuntimeScene

    • getViewportHeight(): number
    • getViewportOriginX(): number
    • getViewportOriginX(): number
    • getViewportOriginY(): number
    • getViewportOriginY(): number
    • getViewportWidth(): number
    • getViewportWidth(): number
    • hasLayer(name: string): boolean
    • hasLayer(name: string): boolean
    • isObjectRegistered(objectName: string): boolean

    Returns boolean

    • isObjectRegistered(objectName: string): boolean
    • Check if an object is registered, meaning that instances of it can be created and lives in the container.

      see

      gdjs.RuntimeInstanceContainer#registerObject

      -

      Parameters

      • objectName: string

      Returns boolean

    • onChildrenLocationChanged(): void

    Returns void

    • onChildrenLocationChanged(): void
    • registerObject(objectData: ObjectData): void
    • registerObject(objectData: ObjectData): void
    • removeLayer(layerName: string): void

    Returns void

    • removeLayer(layerName: string): void
    • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void

    Returns void

    • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void
    • Set the data representing the initial shared data of the scene for the specified behavior.

      Parameters

      • name: string

        The name of the behavior

      • sharedData: null | BehaviorSharedData

        The shared data for the behavior, or null to remove it.

        -

      Returns void

    • setLayerIndex(layerName: string, newIndex: number): void

    Returns void

    • setLayerIndex(layerName: string, newIndex: number): void
    • unregisterObject(objectName: string): void

    Returns void

    • unregisterObject(objectName: string): void
    • updateObject(objectData: ObjectData): void

    Returns void

    • updateObject(objectData: ObjectData): void
    • updateObjectsForces(): void

    Returns void

    • updateObjectsForces(): void

    Constructors

    Properties

    pathfindingObstaclesManager: PathfindingObstaclesManager
    tileMapCollisionMaskManager: TileMapRuntimeManager

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Base class for 3D objects.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,68 +78,68 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • flipZ(enable: boolean): void
    • get3DRendererObject(): Object3D<Object3DEventMap>
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • flipZ(enable: boolean): void
    • get3DRendererObject(): Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -147,75 +147,75 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getCenterZ(): number
    • getCenterZ(): number
    • Return the Z position of the object center, relative to the object Z position (getDrawableX).

      Use getCenterZInScene to get the position of the center in the scene.

      Returns number

      the Z position of the object center, relative to getDrawableZ().

      -
    • getCenterZInScene(): number
    • getCenterZInScene(): number
    • getDepth(): number
    • getDepth(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getDrawableZ(): number
    • getDrawableZ(): number
    • Get the Z position of the rendered object.

      For most objects, this will returns the same value as getZ(). But if the object has an origin that is not the same as the point (0,0,0) of the object displayed, getDrawableZ will differ.

      Returns number

      The Z position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -240,191 +240,191 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): null
    • getRotationX(): number
    • getRendererObject(): null
    • getRotationX(): number
    • getRotationY(): number
    • getRotationY(): number
    • getScale(): number
    • getScale(): number
    • Get the scale of the object (or the geometric average of X, Y and Z scale in case they are different).

      Returns number

      the scale of the object (or the geometric average of X, Y and Z scale in case they are different).

      -
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getScaleZ(): number
    • getScaleZ(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getUnrotatedAABBMaxZ(): number
    • getUnrotatedAABBMaxZ(): number
    • getUnrotatedAABBMinZ(): number
    • getUnrotatedAABBMinZ(): number
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZ(): number

    Returns number

    • getZ(): number
    • getZOrder(): number
    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean
    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isFlippedZ(): boolean
    • isHidden(): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isFlippedZ(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -433,43 +433,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -480,7 +480,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -489,7 +489,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -515,7 +515,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • RuntimeObject3DRenderer

    Index

    Constructors

    Methods

    • get3DRendererObject(): Object3D<Object3DEventMap>
    • updatePosition(): void
    • updateRotation(): void
    • updateSize(): void
    • updateVisibility(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • RuntimeObject3DRenderer

    Index

    Constructors

    Methods

    • get3DRendererObject(): Object3D<Object3DEventMap>
    • updatePosition(): void
    • updateRotation(): void
    • updateSize(): void
    • updateVisibility(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A scene being played, containing instances of objects rendered on screen.

    -

    Hierarchy

    Index

    Methods

    • addLayer(layerData: LayerData): void

    Hierarchy

    Index

    Methods

    • addLayer(layerData: LayerData): void
    • convertCoords(x: number, y: number, result: FloatPoint): FloatPoint

    Returns void

    • convertCoords(x: number, y: number, result: FloatPoint): FloatPoint
    • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint
    • convertInverseCoords(sceneX: number, sceneY: number, result: FloatPoint): FloatPoint
    • createNewUniqueId(): number
    • createNewUniqueId(): number
    • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, zPos: number, trackByPersistentUuid: boolean): void
    • createObjectsFrom(data: InstanceData[], xPos: number, yPos: number, zPos: number, trackByPersistentUuid: boolean): void
    • Create objects from initial instances data (for example, the initial instances of the scene or the instances of an external layout).

      Parameters

      • data: InstanceData[]
        @@ -34,160 +34,160 @@
      • trackByPersistentUuid: boolean

        If true, objects are tracked by setting their persistentUuid to the same as the associated instance. Useful for hot-reloading when instances are changed.

        -

      Returns void

    • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void

    Returns void

    • enableDebugDraw(enableDebugDraw: boolean, showHiddenInstances: boolean, showPointsNames: boolean, showCustomPoints: boolean): void
    • getAllLayerNames(result: string[]): void
    • getAllLayerNames(result: string[]): void
    • getBackgroundColor(): number

    Returns void

    • getBackgroundColor(): number
    • getClearCanvas(): boolean
    • getClearCanvas(): boolean
    • getElapsedTime(): number
    • getElapsedTime(): number
    • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
    • getInitialSharedDataForBehavior(name: string): null | BehaviorSharedData
    • getInstancesCountOnScene(objectName: string): number
    • getInstancesCountOnScene(objectName: string): number
    • getName(): string
    • getName(): string
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): null | LayoutNetworkSyncData
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): null | LayoutNetworkSyncData
    • getOrCreateNetworkId(): string
    • getOrCreateNetworkId(): string
    • getRequestedScene(): string
    • getRequestedScene(): string
    • getViewportHeight(): number
    • getViewportHeight(): number
    • getViewportOriginX(): number
    • getViewportOriginX(): number
    • getViewportOriginY(): number
    • getViewportOriginY(): number
    • getViewportWidth(): number
    • getViewportWidth(): number
    • hasLayer(name: string): boolean
    • hasLayer(name: string): boolean
    • isObjectRegistered(objectName: string): boolean

    Returns boolean

    • isObjectRegistered(objectName: string): boolean
    • loadFromScene(sceneAndExtensionsData: null | SceneAndExtensionsData): void
    • loadFromScene(sceneAndExtensionsData: null | SceneAndExtensionsData): void
    • Load the runtime scene from the given scene.

      see

      gdjs.RuntimeGame#getSceneAndExtensionsData

      -

      Parameters

      • sceneAndExtensionsData: null | SceneAndExtensionsData

      Returns void

    • onChildrenLocationChanged(): void

    Returns void

    • onChildrenLocationChanged(): void
    • onGameResolutionResized(): void
    • onGameResolutionResized(): void
    • Should be called when the canvas where the scene is rendered has been resized. See gdjs.RuntimeGame.startGameLoop in particular.

      -

      Returns void

    • onPause(): void
    • onPause(): void
    • Called when a scene is "paused", i.e it will be not be rendered again for some time, until it's resumed or unloaded.

      -

      Returns void

    • onResume(): void
    • onResume(): void
    • registerObject(objectData: ObjectData): void
    • registerObject(objectData: ObjectData): void
    • removeLayer(layerName: string): void

    Returns void

    • removeLayer(layerName: string): void
    • render(): void

    Returns void

    • render(): void
    • renderAndStep(elapsedTime: number): boolean
    • renderAndStep(elapsedTime: number): boolean
    • Step and render the scene.

      Parameters

      • elapsedTime: number

        In milliseconds

      Returns boolean

      true if the game loop should continue, false if a scene change/push/pop or a game stop was requested.

      -
    • Request a scene change to be made. The change is handled externally (see gdjs.SceneStack) thanks to getRequestedChange and getRequestedScene methods.

      Parameters

      • change: SceneChangeRequest

        One of RuntimeScene.CONTINUE|PUSH_SCENE|POP_SCENE|REPLACE_SCENE|CLEAR_SCENES|STOP_GAME.

      • Optional sceneName: string

        The name of the new scene to launch, if applicable.

        -

      Returns void

    • sceneJustResumed(): boolean

    Returns void

    • sceneJustResumed(): boolean
    • Check if the scene was just resumed. This is true during the first frame after the scene has been unpaused.

      Returns boolean

      true if the scene was just resumed

      -
    • setBackgroundColor(r: number, g: number, b: number): void
    • setBackgroundColor(r: number, g: number, b: number): void
    • Change the background color, by setting the RGB components. Internally, the color is stored as an hexadecimal number.

      Parameters

      • r: number
        @@ -196,62 +196,62 @@

        The color green component (0-255).

      • b: number

        The color blue component (0-255).

        -

      Returns void

    • setClearCanvas(shouldClearCanvas: boolean): void

    Returns void

    • setClearCanvas(shouldClearCanvas: boolean): void
    • Set whether the canvas should be cleared before this scene rendering. This is experimental: if possible, try to avoid relying on this and use custom objects to build complex scenes.

      -

      Parameters

      • shouldClearCanvas: boolean

      Returns void

    • setEventsFunction(func: () => void): void
    • setEventsFunction(func: () => void): void
    • Set the function called each time the scene is stepped. The function will be passed the runtimeScene as argument.

      Note that this is already set up by the gdjs.RuntimeScene constructor and that you should not need to use this method.

      Parameters

      • func: () => void

        The function to be called.

        -
          • (): void
          • Returns void

      Returns void

    • setEventsGeneratedCodeFunction(sceneData: LayoutData): void

    Returns void

    • setEventsGeneratedCodeFunction(sceneData: LayoutData): void
    • Set the function called each time the scene is stepped to be the events generated code, which is by convention assumed to be a function in gdjs with a name based on the scene mangled name.

      Parameters

      • sceneData: LayoutData

        The scene data, used to find where the code was generated.

        -

      Returns void

    • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void

    Returns void

    • setInitialSharedDataForBehavior(name: string, sharedData: null | BehaviorSharedData): void
    • setLayerIndex(layerName: string, newIndex: number): void

    Returns void

    • setLayerIndex(layerName: string, newIndex: number): void
    • startProfiler(onProfilerStopped: (oldProfiler: Profiler) => void): void

    Returns void

    • startProfiler(onProfilerStopped: (oldProfiler: Profiler) => void): void
    • Start a new profiler to measures the time passed in sections of the engine in the scene.

      Parameters

      • onProfilerStopped: (oldProfiler: Profiler) => void

        Function to be called when the profiler is stopped. Will be passed the profiler as argument.

        -

      Returns void

    • stopProfiler(): void

    Returns void

    • stopProfiler(): void
    • unloadScene(): void
    • unloadScene(): void
    • unregisterObject(objectName: string): void
    • unregisterObject(objectName: string): void
    • updateFromNetworkSyncData(syncData: LayoutNetworkSyncData): void
    • updateObject(objectData: ObjectData): void

    Returns void

    • updateFromNetworkSyncData(syncData: LayoutNetworkSyncData): void
    • updateObject(objectData: ObjectData): void
    • updateObjectsForces(): void

    Returns void

    • updateObjectsForces(): void

    Constructors

    Constructors

    Properties

    networkId: null | string = null
    +

    Returns RuntimeScene

    Properties

    networkId: null | string = null

    A network ID associated to the scene to be used for multiplayer, to identify the scene across peers. A scene can have its networkId re-generated during the game, meaning that the scene is re-created on every peer.

    -
    pathfindingObstaclesManager: PathfindingObstaclesManager
    physics2SharedData: null | Physics2SharedData
    tileMapCollisionMaskManager: TileMapRuntimeManager

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The renderer for a gdjs.RuntimeScene using Pixi.js.

    -

    Hierarchy

    • RuntimeScenePixiRenderer

    Implements

    Index

    Constructors

    Methods

    • get3DRendererObject(): null
    • getPIXIContainer(): Container<DisplayObject>
    • getPIXIRenderer(): null | Renderer
    • getRendererObject(): Container<DisplayObject>
    • hideCursor(): void
    • onGameResolutionResized(): void
    • onSceneUnloaded(): void
    • render(): void
    • renderForVR(): void

    Hierarchy

    • RuntimeScenePixiRenderer

    Implements

    Index

    Constructors

    Methods

    • get3DRendererObject(): null
    • getPIXIContainer(): Container<DisplayObject>
    • getPIXIRenderer(): null | Renderer
    • getRendererObject(): Container<DisplayObject>
    • hideCursor(): void
    • onGameResolutionResized(): void
    • onSceneUnloaded(): void
    • render(): void
    • renderForVR(): void
    • Unless you know what you are doing, use the VR extension instead of this function directly.

      In VR, only 3D elements can be rendered, 2D cannot. This rendering method skips over all 2D layers and elements, and simply renders the 3D content. @@ -21,9 +21,9 @@

      Note to engine developers: threeRenderer.resetState() may NOT be called in this function, as WebXR modifies the WebGL state in a way that resetting it will cause an improper render that will lead to a black screen being displayed in VR mode.

      -

      Returns void

    • showCursor(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A behavior that forwards the Scalable interface to its object.

    -

    Hierarchy

    Implements

    Index

    Methods

    • activate(enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean

    Returns void

    • activated(): boolean
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getScale(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getScale(): number
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • setScale(newScale: number): void
    • setScale(newScale: number): void
    • setScaleX(newScale: number): void
    • setScaleX(newScale: number): void
    • setScaleY(newScale: number): void
    • setScaleY(newScale: number): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hold the stack of scenes (gdjs.RuntimeScene) being played.

    -

    Hierarchy

    • SceneStack

    Index

    Methods

    • applyUpdateFromNetworkSyncDataIfAny(): void

    Hierarchy

    • SceneStack

    Index

    Methods

    • applyUpdateFromNetworkSyncDataIfAny(): void
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): null | SceneStackNetworkSyncData
    • onGameResolutionResized(): void
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): null | SceneStackNetworkSyncData
    • onGameResolutionResized(): void
    • Called by the RuntimeGame when the game resolution is changed. Useful to notify scene and layers that resolution is changed, as they might be caching it.

      -

      Returns void

    • pop(popCount?: number): void
    • push(newSceneName: string, externalLayoutName?: string): null | RuntimeScene
    • pop(popCount?: number): void
    • push(newSceneName: string, externalLayoutName?: string): null | RuntimeScene
    • Pause the scene currently being played and start the new scene that is specified. If externalLayoutName is set, also instantiate the objects from this external layout.

      -

      Parameters

      • newSceneName: string
      • Optional externalLayoutName: string

      Returns null | RuntimeScene

    • renderWithoutStep(): boolean
    • replace(newSceneName: string, clear?: boolean): null | RuntimeScene
    • renderWithoutStep(): boolean
    • replace(newSceneName: string, clear?: boolean): null | RuntimeScene
    • Start the specified scene, replacing the one currently being played. If clear is set to true, all running scenes are also removed from the stack of scenes.

      -

      Parameters

      • newSceneName: string
      • Optional clear: boolean

      Returns null | RuntimeScene

    • step(elapsedTime: number): boolean
    • updateFromNetworkSyncData(sceneStackSyncData: SceneStackNetworkSyncData): void
    • wasFirstSceneLoaded(): boolean
    • step(elapsedTime: number): boolean
    • updateFromNetworkSyncData(sceneStackSyncData: SceneStackNetworkSyncData): void
    • wasFirstSceneLoaded(): boolean

    Constructors

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The ShapePainterRuntimeObject allows to draw graphics shapes on screen.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • areCoordinatesRelative(): boolean
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • areCoordinatesRelative(): boolean
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • beginFillPath(x1: number, y1: number): void
    • behaviorActivated(name: string): boolean
    • beginFillPath(x1: number, y1: number): void
    • behaviorActivated(name: string): boolean
    • clear(): void
    • clear(): void
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • closePath(): void
    • closePath(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -80,70 +80,70 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • drawArc(centerX: number, centerY: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean, closePath: boolean): void
    • drawBezierCurve(x1: number, y1: number, cpX: number, cpY: number, cpX2: number, cpY2: number, x2: number, y2: number): void
    • drawChamferRectangle(startX1: number, startY1: number, endX2: number, endY2: number, chamfer: number): void
    • drawCircle(x: number, y: number, radius: number): void
    • drawEllipse(centerX: number, centerY: number, width: number, height: number): void
    • drawFilletRectangle(startX1: number, startY1: number, endX2: number, endY2: number, fillet: number): void
    • drawLine(x1: number, y1: number, x2: number, y2: number, thickness: number): void
    • drawLineV2(x1: number, y1: number, x2: number, y2: number, thickness: number): void
    • drawPathArc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): void
    • drawPathBezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): void
    • drawPathLineTo(x1: number, y1: number): void
    • drawPathMoveTo(x1: number, y1: number): void
    • drawPathQuadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): void
    • drawQuadraticCurve(x1: number, y1: number, cpX: number, cpY: number, x2: number, y2: number): void
    • drawRectangle(x1: number, y1: number, x2: number, y2: number): void
    • drawRegularPolygon(centerX: number, centerY: number, sides: number, radius: number, rotation: number): void
    • drawRoundedRectangle(startX1: number, startY1: number, endX2: number, endY2: number, radius: number): void
    • drawStar(centerX: number, centerY: number, points: number, radius: number, innerRadius: number, rotation: number): void
    • drawTorus(centerX: number, centerY: number, innerRadius: number, outerRadius: number, startArc: number, endArc: number): void
    • enableEffect(name: string, enable: boolean): void
    • drawArc(centerX: number, centerY: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean, closePath: boolean): void
    • drawBezierCurve(x1: number, y1: number, cpX: number, cpY: number, cpX2: number, cpY2: number, x2: number, y2: number): void
    • drawChamferRectangle(startX1: number, startY1: number, endX2: number, endY2: number, chamfer: number): void
    • drawCircle(x: number, y: number, radius: number): void
    • drawEllipse(centerX: number, centerY: number, width: number, height: number): void
    • drawFilletRectangle(startX1: number, startY1: number, endX2: number, endY2: number, fillet: number): void
    • drawLine(x1: number, y1: number, x2: number, y2: number, thickness: number): void
    • drawLineV2(x1: number, y1: number, x2: number, y2: number, thickness: number): void
    • drawPathArc(cx: number, cy: number, radius: number, startAngle: number, endAngle: number, anticlockwise: boolean): void
    • drawPathBezierCurveTo(cpX: number, cpY: number, cpX2: number, cpY2: number, toX: number, toY: number): void
    • drawPathLineTo(x1: number, y1: number): void
    • drawPathMoveTo(x1: number, y1: number): void
    • drawPathQuadraticCurveTo(cpX: number, cpY: number, toX: number, toY: number): void
    • drawQuadraticCurve(x1: number, y1: number, cpX: number, cpY: number, x2: number, y2: number): void
    • drawRectangle(x1: number, y1: number, x2: number, y2: number): void
    • drawRegularPolygon(centerX: number, centerY: number, sides: number, radius: number, rotation: number): void
    • drawRoundedRectangle(startX1: number, startY1: number, endX2: number, endY2: number, radius: number): void
    • drawStar(centerX: number, centerY: number, points: number, radius: number, innerRadius: number, rotation: number): void
    • drawTorus(centerX: number, centerY: number, innerRadius: number, outerRadius: number, startArc: number, endArc: number): void
    • enableEffect(name: string, enable: boolean): void
    • endFillPath(): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • endFillPath(): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>

    Returns void

    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -151,60 +151,60 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • getDrawableY(): number
    • getDrawableY(): number
    • getFillColorB(): number
    • getFillColorG(): number
    • getFillColorR(): number
    • getFillOpacity(): number
    • getHeight(): number

    Returns number

    • getFillColorB(): number
    • getFillColorG(): number
    • getFillColorR(): number
    • getFillOpacity(): number
    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -229,181 +229,181 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getNetworkSyncData(): ObjectNetworkSyncData
    • getNetworkSyncData(): ObjectNetworkSyncData
    • getOutlineColorB(): number
    • getOutlineColorG(): number
    • getOutlineColorR(): number
    • getOutlineOpacity(): number
    • getOutlineSize(): number
    • getOutlineColorB(): number
    • getOutlineColorG(): number
    • getOutlineColorR(): number
    • getOutlineOpacity(): number
    • getOutlineSize(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Graphics
    • getRotationCenterX(): number
    • getRendererObject(): Graphics
    • getRotationCenterX(): number
    • getRotationCenterY(): number
    • getRotationCenterY(): number
    • getScale(): number
    • getScale(): number
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateBounds(): void
    • invalidateHitboxes(): void
    • invalidateBounds(): void
    • invalidateHitboxes(): void
    • isClearedBetweenFrames(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isClearedBetweenFrames(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isHidden(): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -412,43 +412,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -459,7 +459,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -468,7 +468,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -494,7 +494,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • Parameters

      • instanceContainer: RuntimeInstanceContainer

        The container the object belongs to.

      • shapePainterObjectData: ShapePainterObjectData

        The initial properties of the object

        diff --git a/GDJS Runtime Documentation/classes/gdjs.ShopifyClientsManager.html b/GDJS Runtime Documentation/classes/gdjs.ShopifyClientsManager.html index 80520d6b0..8cf4ae8fb 100644 --- a/GDJS Runtime Documentation/classes/gdjs.ShopifyClientsManager.html +++ b/GDJS Runtime Documentation/classes/gdjs.ShopifyClientsManager.html @@ -1,4 +1,4 @@ -ShopifyClientsManager | GDevelop JavaScript game engine
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Legend

        • Constructor
        • Static method

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Legend

        • Constructor
        • Static method

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        SpineManager manages pixi spine skeleton data.

        -

        Hierarchy

        • SpineManager

        Implements

        Index

        Constructors

        Methods

        • getResourceKinds(): ResourceKind[]

        Hierarchy

        • SpineManager

        Implements

        Index

        Constructors

        Methods

        • getResourceKinds(): ResourceKind[]
        • getSpine(resourceName: string): null | ISkeletonData<IBoneData, ISlotData, ISkin, IAnimation<ITimeline>, IEventData, IIkConstraintData, ITransformConstraintData, IPathConstraintData>
        • getSpine(resourceName: string): null | ISkeletonData<IBoneData, ISlotData, ISkin, IAnimation<ITimeline>, IEventData, IIkConstraintData, ITransformConstraintData, IPathConstraintData>
        • Get the object for the given resource that is already loaded (preloaded or loaded with loadJson). If the resource is not loaded, null will be returned.

          Parameters

          • resourceName: string

            The name of the spine skeleton.

          Returns null | ISkeletonData<IBoneData, ISlotData, ISkin, IAnimation<ITimeline>, IEventData, IIkConstraintData, ITransformConstraintData, IPathConstraintData>

          the spine skeleton if loaded, null otherwise.

          -
        • isSpineLoaded(resourceName: string): boolean
        • isSpineLoaded(resourceName: string): boolean
        • Check if the given spine skeleton was loaded.

          Parameters

          • resourceName: string

            The name of the spine skeleton.

          Returns boolean

          true if the content of the spine skeleton is loaded, false otherwise.

          -
        • loadResource(resourceName: string): Promise<void>
        • loadResource(resourceName: string): Promise<void>
        • processResource(resourceName: string): Promise<void>
        • processResource(resourceName: string): Promise<void>
        • addForce(x: number, y: number, multiplier: number): void
        • Add a force to the object to move it.

          Parameters

          • x: number

            The x coordinates of the force

            @@ -16,7 +16,7 @@

            The y coordinates of the force

          • multiplier: number

            Set the force multiplier

            -

          Returns void

        • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

        Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -76,78 +76,78 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number
    • getAnimationDuration(): number
    • getAnimationElapsedTime(): number
    • getAnimationIndex(): number

    Returns number

    • getAnimationDuration(): number
    • getAnimationElapsedTime(): number
    • getAnimationIndex(): number
    • getAnimationIndexFor(animationName: string): number
    • getAnimationMixingDuration(): number
    • getAnimationIndexFor(animationName: string): number
    • getAnimationMixingDuration(): number
    • getAnimationName(): string
    • getAnimationName(): string
    • getAnimationSpeedScale(): number
    • getAnimationSpeedScale(): number
    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -155,59 +155,59 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -232,128 +232,128 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Container<DisplayObject> | Spine
    • getRendererObject(): Container<DisplayObject> | Spine
    • getScale(): number
    • getScale(): number
    • Get the scale of the object (or the geometric mean of the X and Y scale in case they are different).

      Returns number

      the scale of the object (or the geometric mean of the X and Y scale in case they are different).

      -
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasAnimationEnded(): boolean
    • hasAnimationEnded(): boolean
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isAnimationIndex(animationIndex: number): boolean
    • isAnimationPaused(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isAnimationIndex(animationIndex: number): boolean
    • isAnimationPaused(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isHidden(): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -421,43 +421,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseAnimation(): void
    • pauseTimer(timerName: string): void

    Returns void

    • pauseAnimation(): void
    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -468,7 +468,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -477,7 +477,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -503,7 +503,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    • objectData: ObjectData

    Returns void

    • removeBehavior(name: string): boolean
    • removeBehavior(name: string): boolean
    • Remove the behavior with the given name. Usually only used by hot-reloading, as performance of this operation is not guaranteed (in the future, this could lead to re-organization of arrays @@ -511,77 +511,77 @@

      Parameters

      • name: string

        The name of the behavior to remove.

      Returns boolean

      true if the behavior was properly removed, false otherwise.

      -
    • removeEffect(effectName: string): boolean
    • removeEffect(effectName: string): boolean
    • removeTimer(timerName: string): void

    Returns boolean

    • removeTimer(timerName: string): void
    • resetTimer(timerName: string): void

    Returns void

    • resetTimer(timerName: string): void
    • resumeAnimation(): void

    Returns void

    • resumeAnimation(): void
    • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
    • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean

    Returns void

    • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
    • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean
    • Separate the object from others objects, using their hitboxes.

      Parameters

      • objects: RuntimeObject[]

        Objects

      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if the object was moved

      -
    • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
    • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
    • Separate the object from others objects, using their hitboxes.

      Parameters

      • objectsLists: ObjectsLists

        Tables of objects

      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if the object was moved

      -
    • separateObjectsWithForces(objectsLists: ObjectsLists): void
    • separateObjectsWithForces(objectsLists: ObjectsLists): void
    • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
    • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
    • setAngle(angle: number): void

    Returns void

    • setAngle(angle: number): void
    • setAnimationElapsedTime(time: number): void
    • setAnimationElapsedTime(time: number): void
    • setAnimationIndex(animationIndex: number): void
    • setAnimationIndex(animationIndex: number): void
    • setAnimationIndexWithMixing(animationIndex: number, mixingDuration: number): void
    • setAnimationMixingDuration(animationMixingDuration: number): void
    • setAnimationIndexWithMixing(animationIndex: number, mixingDuration: number): void
    • setAnimationMixingDuration(animationMixingDuration: number): void
    • setAnimationName(animationName: string): void
    • setAnimationName(animationName: string): void
    • setAnimationNameWithMixing(animationName: string, mixingDuration: number): void
    • setAnimationSpeedScale(ratio: number): void
    • setCenterPositionInScene(x: number, y: number): void
    • setAnimationNameWithMixing(animationName: string, mixingDuration: number): void
    • setAnimationSpeedScale(ratio: number): void
    • setCenterPositionInScene(x: number, y: number): void
    • setCenterXInScene(x: number): void

    Returns void

    • setCenterXInScene(x: number): void
    • setCenterYInScene(y: number): void

    Returns void

    • setCenterYInScene(y: number): void
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean

    Returns boolean

    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean

    Returns boolean

    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean
    • setHeight(newHeight: number): void

    Returns boolean

    • setHeight(newHeight: number): void
    • setIncludedInParentCollisionMask(isIncluded: boolean): void
    • setLayer(layer: string): void
    • setIncludedInParentCollisionMask(isIncluded: boolean): void
    • setLayer(layer: string): void
    • setOpacity(opacity: number): void

    Returns void

    • setOpacity(opacity: number): void
    • setPosition(x: number, y: number): void
    • setPosition(x: number, y: number): void
    • setScale(newScale: number): void

    Returns void

    • setScale(newScale: number): void
    • setScaleX(newScale: number): void
    • setScaleX(newScale: number): void
    • setScaleY(newScale: number): void
    • setScaleY(newScale: number): void
    • setSize(newWidth: number, newHeight: number): void
    • setSize(newWidth: number, newHeight: number): void
    • setVariableNumber(variable: Variable, newValue: number): void
    • setVariableNumber(variable: Variable, newValue: number): void
    • setVariableString(variable: Variable, newValue: string): void

    Returns void

    • setVariableString(variable: Variable, newValue: string): void
    • setWidth(newWidth: number): void

    Returns void

    • setWidth(newWidth: number): void
    • setX(x: number): void
    • setX(x: number): void
    • setY(y: number): void
    • setY(y: number): void
    • setZOrder(z: number): void
    • setZOrder(z: number): void

    Returns void

    • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
    • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
    • Compare a timer elapsed time. If the timer does not exist, it is created.

      deprecated

      prefer using getTimerElapsedTimeInSecondsOrNaN.

      Parameters

      • timerName: string
        @@ -661,167 +661,167 @@
      • timeInSeconds: number

        The time value to check in seconds.

      Returns boolean

      True if the timer exists and its value is greater than or equal than the given time, false otherwise.

      -
    • timerPaused(timerName: string): boolean
    • timerPaused(timerName: string): boolean
    • unpauseTimer(timerName: string): void
    • unpauseTimer(timerName: string): void
    • unregisterDestroyCallback(callback: () => void): void

    Returns void

    • unregisterDestroyCallback(callback: () => void): void
    • updateAABB(): void
    • updateAABB(): void
    • Update the AABB (axis aligned bounding box) for the object.

      Default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box.

      You should not call this function by yourself, it is called when necessary by getAABB method. However, you can redefine it if your object can have a faster implementation.

      -

      Returns void

    • updateAllEffectParameters(effectData: EffectData): boolean
    • updateAllEffectParameters(effectData: EffectData): boolean
    • updateForces(elapsedTime: number): void

    Returns boolean

    • updateForces(elapsedTime: number): void
    • updateHitBoxes(): void
    • updateHitBoxes(): void
    • Update the hit boxes for the object.

      The default implementation set a basic bounding box based on the size (getWidth and getHeight) and the center point of the object (getCenterX and getCenterY). Result is cached until invalidated (by a position change, angle change...).

      You should not call this function by yourself, it is called when necessary by getHitBoxes method. However, you can redefine it if your object need custom hit boxes.

      -

      Returns void

    • updateTimers(elapsedTime: number): void

    Returns void

    • updateTimers(elapsedTime: number): void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    spineResourceName: string
    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    spineResourceName: string
    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • Parameters

      • instanceContainer: RuntimeInstanceContainer

        The container the object belongs to.

      • objectData: SpineObjectData

        The object data used to initialize the object

        diff --git a/GDJS Runtime Documentation/classes/gdjs.SpineRuntimeObjectPixiRenderer.html b/GDJS Runtime Documentation/classes/gdjs.SpineRuntimeObjectPixiRenderer.html index 9c3d10794..92b4fe0a3 100644 --- a/GDJS Runtime Documentation/classes/gdjs.SpineRuntimeObjectPixiRenderer.html +++ b/GDJS Runtime Documentation/classes/gdjs.SpineRuntimeObjectPixiRenderer.html @@ -1,8 +1,8 @@ -SpineRuntimeObjectPixiRenderer | GDevelop JavaScript game engine
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Hierarchy

        • SpineRuntimeObjectPixiRenderer

        Index

        Constructors

        • Parameters

          • runtimeObject: SpineRuntimeObject
            +SpineRuntimeObjectPixiRenderer | GDevelop JavaScript game engine
            Options
            All
            • Public
            • Public/Protected
            • All
            Menu

            Hierarchy

            • SpineRuntimeObjectPixiRenderer

            Index

            Constructors

            Methods

            • getAnimationDuration(sourceAnimationName: string): number
            • getAnimationElapsedTime(): number
            • getHeight(): number
            • getOriginOffset(): Point
            • getRendererObject(): Container<DisplayObject> | Spine
            • getUnscaledHeight(): number
            • getUnscaledWidth(): number
            • getWidth(): number
            • isAnimationComplete(): boolean
            • onDestroy(): void
            • setAnimation(animation: string, loop: boolean): void
            • setAnimationElapsedTime(time: number): void
            • setHeight(height: number): void
            • setMixing(from: string, to: string, duration: number): void
            • setWidth(width: number): void
            • updateAngle(): void
            • updateAnimation(timeDelta: number): void
            • updateOpacity(): void
            • updatePosition(): void
            • updateScale(): void
            • constructRendererObject(): Container<DisplayObject> | Spine

            Legend

            • Constructor
            • Method
            • Private method

            Settings

            Theme

            Generated using TypeDoc

            Options
            All
            • Public
            • Public/Protected
            • All
            Menu

            Represents an animation of a SpriteRuntimeObject.

            -

            Type parameters

            • T

            Hierarchy

            • SpriteAnimation

            Index

            Constructors

            Type parameters

            • T

            Hierarchy

            • SpriteAnimation

            Index

            Constructors

            Properties

            directions: SpriteAnimationDirection<T>[] = []
            hasMultipleDirections: boolean
            name: string

            Methods

            Properties

            directions: SpriteAnimationDirection<T>[] = []
            hasMultipleDirections: boolean
            name: string

            Methods

            Methods

            • Get a point of the frame.
              If the point does not exist, the origin is returned.

              Parameters

              • name: string

                The point's name

              Returns SpritePoint

              The requested point. If it doesn't exists returns the origin point.

              -

            Methods

            • getAngle(angle: number): number
            • getAnimationDuration(): number
            • getAnimationElapsedTime(): number
            • getAnimationFrameCount(): number
            • getAnimationFrameIndex(): number
            • Get the index of the current frame displayed by the animation

              Returns number

              newFrame The index of the frame being displayed

              -
            • getAnimationIndex(): number
            • getAnimationIndex(): number
            • getAnimationName(): string
            • getAnimationName(): string
            • getAnimationSpeedScale(): number
            • getDirectionOrAngle(angle: number): number
            • hasAnimationEnded(): boolean
            • getAnimationSpeedScale(): number
            • getDirectionOrAngle(angle: number): number
            • hasAnimationEnded(): boolean
            • hasAnimationEndedLegacy(): boolean

            Returns boolean

        • hasAnimationEndedLegacy(): boolean
        • invalidateFrame(): void
        • isAnimationPaused(): boolean
        • pauseAnimation(): void
        • resumeAnimation(): void
        • setAngle(oldAngle: number, angle: number): null | number
        • setAnimationElapsedTime(time: number): boolean
        • invalidateFrame(): void
        • isAnimationPaused(): boolean
        • pauseAnimation(): void
        • resumeAnimation(): void
        • setAngle(oldAngle: number, angle: number): null | number
        • setAnimationElapsedTime(time: number): boolean
        • setAnimationFrameIndex(newFrameIndex: number): boolean
        • setAnimationFrameIndex(newFrameIndex: number): boolean
        • Change the current frame displayed by the animation

          Parameters

          • newFrameIndex: number

            The index of the frame to be displayed

            -

          Returns boolean

        • setAnimationIndex(newAnimation: number): boolean

        Returns boolean

    • setAnimationIndex(newAnimation: number): boolean
    • setAnimationName(newAnimationName: string): boolean
    • setAnimationName(newAnimationName: string): boolean
    • setAnimationSpeedScale(ratio: number): void
    • setDirectionOrAngle(oldValue: number, newValue: number): null | number
    • setAnimationSpeedScale(ratio: number): void
    • setDirectionOrAngle(oldValue: number, newValue: number): null | number
    • Change the angle (or direction index) of the object

      -
      deprecated

      Parameters

      • oldValue: number
      • newValue: number

      Returns null | number

    • setOnFrameChangeCallback(callback: () => void): void
    • setOnFrameChangeCallback(callback: () => void): void
    • Register a listener to frame changes.

      It's useful for custom objects as they don't drive this class themselves.

      Parameters

      • callback: () => void

        Called each time getCurrentFrame changes.

        -
          • (): void
          • Returns void

      Returns void

    • step(timeDelta: number): boolean

    Returns void

    • step(timeDelta: number): boolean
    • Update the current frame of the object according to the elapsed time on the scene.

      Parameters

      • timeDelta: number

        in seconds

        -

      Returns boolean

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The SpriteRuntimeObject represents an object that can display images.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • animationPaused(): boolean
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • animationPaused(): boolean
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -79,84 +79,84 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>

    Returns void

    • flipX(enable: boolean): void
    • flipY(enable: boolean): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number
    • getAnimation(): number

    Returns number

    • getAnimation(): number
    • Get the index of the animation being played.

      deprecated

      Use getAnimationIndex instead

      Returns number

      The index of the new animation being played

      -
    • getAnimationDuration(): number
    • getAnimationElapsedTime(): number
    • getAnimationFrame(): number
    • getAnimationDuration(): number
    • getAnimationElapsedTime(): number
    • getAnimationFrame(): number
    • getAnimationFrameCount(): number
    • getAnimationIndex(): number
    • getAnimationFrameCount(): number
    • getAnimationIndex(): number
    • getAnimationName(): string
    • getAnimationName(): string
    • getAnimationSpeedScale(): number
    • getAnimationSpeedScale(): number
    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -164,54 +164,54 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getBlendMode(): number
    • getCenterX(): number
    • getBlendMode(): number
    • getCenterX(): number
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getColor(): string
    • getColor(): string
    • getDirectionOrAngle(): number
    • getDirectionOrAngle(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • getDrawableY(): number
    • getDrawableY(): number
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -236,147 +236,147 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getPointPosition(name: string): [x: number, y: number]
    • getPointPosition(name: string): [x: number, y: number]
    • Get the positions on X and Y axis on the scene of the given point.

      Parameters

      • name: string

        The point name

      Returns [x: number, y: number]

      An array of the position on X and Y axis on the scene of the given point.

      -
    • getPointX(name: string): number
    • getPointX(name: string): number
    • Get the position on X axis on the scene of the given point.

      Parameters

      • name: string

        The point name

      Returns number

      the position on X axis on the scene of the given point.

      -
    • getPointY(name: string): number
    • getPointY(name: string): number
    • Get the position on Y axis on the scene of the given point.

      Parameters

      • name: string

        The point name

      Returns number

      the position on Y axis on the scene of the given point.

      -
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Sprite
    • getRendererObject(): Sprite
    • getScale(): number
    • getScale(): number
    • Get the scale of the object (or the geometric mean of the X and Y scale in case they are different).

      Returns number

      the scale of the object (or the geometric mean of the X and Y scale in case they are different).

      -
    • getScaleMean(): number
    • getScaleMean(): number
    • Get the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).

      deprecated

      Use getScale instead.

      Returns number

      the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).

      -
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasAnimationEnded(): boolean
    • hasAnimationEnded(): boolean
    • hasAnimationEnded2(): boolean
    • hasAnimationEnded2(): boolean
    • Return true if animation has ended. The animation had ended if:

        @@ -393,61 +393,61 @@
      • the last frame has been displayed long enough.
      deprecated

      Use hasAnimationEnded instead.

      -

      Returns boolean

    • hasAnimationEndedLegacy(): boolean
    • hasAnimationEndedLegacy(): boolean
    • deprecated

      Return true if animation has ended. Prefer using hasAnimationEnded2. This method returns true as soon as the animation enters the last frame, not at the end of the last frame.

      -

      Returns boolean

    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isAnimationPaused(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isAnimationPaused(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCurrentAnimationName(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isCurrentAnimationName(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isHidden(): boolean
    • isFlippedX(): boolean
    • isFlippedY(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -456,44 +456,44 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseAnimation(): void
    • pauseTimer(timerName: string): void

    Returns void

    • pauseAnimation(): void
    • pauseTimer(timerName: string): void
    • playAnimation(): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • playAnimation(): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -504,7 +504,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -513,7 +513,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • registerDestroyCallback(callback: () => void): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -539,7 +539,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    opacity: number = 255
    persistentUuid: null | string = null
    +
    opacity: number = 255
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    Methods

    • ensureUpToDate(): void
    • getAnimationFrameTextureManager(imageManager: PixiImageManager): PixiAnimationFrameTextureManager
    • getColor(): string
    • getHeight(): number
    • getRendererObject(): Sprite
    • getUnscaledHeight(): number
    • getUnscaledWidth(): number
    • getWidth(): number
    • setColor(rgbColor: any): void
    • update(): void
    • updateAngle(): void
    • getAnimationFrameTextureManager(imageManager: PixiImageManager): PixiAnimationFrameTextureManager
    • getColor(): string
    • getHeight(): number
    • getRendererObject(): Sprite
    • getUnscaledHeight(): number
    • getUnscaledWidth(): number
    • getWidth(): number
    • setColor(rgbColor: any): void
    • update(): void
    • updateAngle(): void
    • updateOpacity(): void
    • updateVisibility(): void
    • updateX(): void
    • updateY(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Methods

    Constructors

    Properties

    Methods

    • +TaskGroup | GDevelop JavaScript game engine
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Hierarchy

      Index

      Methods

      Constructors

      Properties

      Methods

      Constructors

      Properties

      tasks: AsyncTask[] = ...

      Legend

      • Method
      • Inherited constructor
      • Private property

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu
    • activated(): boolean
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • enableSynchronization(enable: boolean): void
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getText(): string
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getText(): string
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • onObjectHotReloaded(): void
    • onObjectHotReloaded(): void
    • setText(text: string): void
    • setText(text: string): void

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The TextEntryRuntimeObject allows to capture text typed on the keyboard.

    -

    Hierarchy

    Index

    Methods

    Properties

    Constructors

    Methods

    • activate(enable: boolean): void
    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Index

    Methods

    Properties

    Constructors

    Methods

    • activate(enable: boolean): void
    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,70 +78,70 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>

    Returns void

    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -149,59 +149,59 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -226,167 +226,167 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getNetworkSyncData(): ObjectNetworkSyncData
    • getNetworkSyncData(): ObjectNetworkSyncData
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getString(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getString(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isActivated(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isActivated(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isHidden(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -395,43 +395,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -442,7 +442,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -451,7 +451,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -477,7 +477,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,67 +78,67 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • focus(): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • focus(): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -146,59 +146,59 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getBorderColor(): string
    • getBorderOpacity(): number
    • getBorderWidth(): number
    • getCenterX(): number
    • getBorderColor(): string
    • getBorderOpacity(): number
    • getBorderWidth(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getFillColor(): string
    • getFillOpacity(): number
    • getFontResourceName(): string
    • getFontSize(): number
    • getHeight(): number

    Returns number

    • getFillColor(): string
    • getFillOpacity(): number
    • getFontResourceName(): string
    • getFontSize(): number
    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -223,179 +223,179 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getInputType(): "number" | "text" | "email" | "password" | "telephone number" | "url" | "search" | "text area"
    • getInputType(): "number" | "text" | "email" | "password" | "telephone number" | "url" | "search" | "text area"
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getPlaceholder(): string
    • getPlaceholder(): string
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): null
    • getRendererObject(): null
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getString(): string

    Returns number

    • getString(): string
    • getText(): string
    • getText(): string
    • getTextColor(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • getTextColor(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isDisabled(): boolean
    • isEffectEnabled(name: string): boolean
    • isDisabled(): boolean
    • isEffectEnabled(name: string): boolean
    • isFocused(): boolean
    • isHidden(): boolean
    • isFocused(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isReadOnly(): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isReadOnly(): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -404,45 +404,45 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void
    • onRendererInputValueChanged(inputValue: string): void

    Returns void

    • onDestroyed(): void
    • onRendererInputValueChanged(inputValue: string): void
    • Called by the renderer when the value of the input shown on the screen was changed (because the user typed something). This does not propagate back the value to the renderer, which would result in the cursor being sent back to the end of the text.

      Do not use this if you are not inside the renderer - use setString instead.

      -

      Parameters

      • inputValue: string

      Returns void

    • pauseTimer(timerName: string): void
    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -453,7 +453,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -462,7 +462,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -488,7 +488,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    • objectData: ObjectData

    Returns void

    • removeBehavior(name: string): boolean
    • removeBehavior(name: string): boolean
    • Remove the behavior with the given name. Usually only used by hot-reloading, as performance of this operation is not guaranteed (in the future, this could lead to re-organization of arrays @@ -496,71 +496,71 @@

      Parameters

      • name: string

        The name of the behavior to remove.

      Returns boolean

      true if the behavior was properly removed, false otherwise.

      -
    • removeEffect(effectName: string): boolean
    • removeEffect(effectName: string): boolean
    • removeTimer(timerName: string): void

    Returns boolean

    • removeTimer(timerName: string): void
    • resetTimer(timerName: string): void

    Returns void

    • resetTimer(timerName: string): void

    Returns void

    • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
    • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean

    Returns void

    • rotateTowardPosition(x: number, y: number, speed: number, scene: RuntimeScene): void
    • separateFromObjects(objects: RuntimeObject[], ignoreTouchingEdges: boolean): boolean
    • Separate the object from others objects, using their hitboxes.

      Parameters

      • objects: RuntimeObject[]

        Objects

      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if the object was moved

      -
    • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
    • separateFromObjectsList(objectsLists: ObjectsLists, ignoreTouchingEdges: boolean): boolean
    • Separate the object from others objects, using their hitboxes.

      Parameters

      • objectsLists: ObjectsLists

        Tables of objects

      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if the object was moved

      -
    • separateObjectsWithForces(objectsLists: ObjectsLists): void
    • separateObjectsWithForces(objectsLists: ObjectsLists): void
    • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
    • separateObjectsWithoutForces(objectsLists: ObjectsLists): void
    • setAngle(angle: number): void

    Returns void

    • setAngle(angle: number): void
    • setBorderColor(newColor: string): void
    • setBorderOpacity(newOpacity: number): void
    • setBorderWidth(width: number): void
    • setCenterPositionInScene(x: number, y: number): void

    Returns void

    • setBorderColor(newColor: string): void
    • setBorderOpacity(newOpacity: number): void
    • setBorderWidth(width: number): void
    • setCenterPositionInScene(x: number, y: number): void
    • setCenterXInScene(x: number): void

    Returns void

    • setCenterXInScene(x: number): void
    • setCenterYInScene(y: number): void

    Returns void

    • setCenterYInScene(y: number): void
    • setDisabled(value: boolean): void
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
    • setDisabled(value: boolean): void
    • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): boolean
    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean

    Returns boolean

    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean

    Returns boolean

    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean
    • setFillColor(newColor: string): void
    • setFillOpacity(newOpacity: number): void
    • setFontResourceName(resourceName: string): void
    • setFontSize(newSize: number): void
    • setHeight(height: number): void

    Returns boolean

    • setFillColor(newColor: string): void
    • setFillOpacity(newOpacity: number): void
    • setFontResourceName(resourceName: string): void
    • setFontSize(newSize: number): void
    • setHeight(height: number): void
    • setIncludedInParentCollisionMask(isIncluded: boolean): void
    • setInputType(newInputType: string): void
    • setIncludedInParentCollisionMask(isIncluded: boolean): void
    • setInputType(newInputType: string): void
    • setLayer(layer: string): void
    • setLayer(layer: string): void
    • setOpacity(opacity: number): void

    Returns void

    • setOpacity(opacity: number): void
    • setPlaceholder(newPlaceholder: string): void
    • setPlaceholder(newPlaceholder: string): void
    • setPosition(x: number, y: number): void
    • setPosition(x: number, y: number): void
    • setReadOnly(value: boolean): void
    • setSize(width: number, height: number): void

    Returns void

    • setReadOnly(value: boolean): void
    • setSize(width: number, height: number): void
    • setString(text: string): void
    • setString(text: string): void
    • setText(newString: string): void
    • setText(newString: string): void
    • setTextColor(newColor: string): void
    • setVariableNumber(variable: Variable, newValue: number): void
    • setTextColor(newColor: string): void
    • setVariableNumber(variable: Variable, newValue: number): void
    • setVariableString(variable: Variable, newValue: string): void

    Returns void

    • setVariableString(variable: Variable, newValue: string): void
    • setWidth(width: number): void

    Returns void

    • setWidth(width: number): void
    • setX(x: number): void
    • setX(x: number): void
    • setY(y: number): void

    Returns void

    • setY(y: number): void
    • setZOrder(z: number): void

    Returns void

    • setZOrder(z: number): void

    Returns void

    • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
    • timerElapsedTime(timerName: string, timeInSeconds: number): boolean
    • Compare a timer elapsed time. If the timer does not exist, it is created.

      deprecated

      prefer using getTimerElapsedTimeInSecondsOrNaN.

      Parameters

      • timerName: string
        @@ -647,167 +647,167 @@
      • timeInSeconds: number

        The time value to check in seconds.

      Returns boolean

      True if the timer exists and its value is greater than or equal than the given time, false otherwise.

      -
    • timerPaused(timerName: string): boolean
    • timerPaused(timerName: string): boolean
    • unpauseTimer(timerName: string): void
    • unpauseTimer(timerName: string): void
    • unregisterDestroyCallback(callback: () => void): void

    Returns void

    • unregisterDestroyCallback(callback: () => void): void
    • updateAABB(): void

    Returns void

    • updateAABB(): void
    • Update the AABB (axis aligned bounding box) for the object.

      Default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box.

      You should not call this function by yourself, it is called when necessary by getAABB method. However, you can redefine it if your object can have a faster implementation.

      -

      Returns void

    • updateAllEffectParameters(effectData: EffectData): boolean
    • updateAllEffectParameters(effectData: EffectData): boolean
    • updateForces(elapsedTime: number): void

    Returns boolean

    • updateForces(elapsedTime: number): void
    • updateHitBoxes(): void
    • updateHitBoxes(): void
    • Update the hit boxes for the object.

      The default implementation set a basic bounding box based on the size (getWidth and getHeight) and the center point of the object (getCenterX and getCenterY). Result is cached until invalidated (by a position change, angle change...).

      You should not call this function by yourself, it is called when necessary by getHitBoxes method. However, you can redefine it if your object need custom hit boxes.

      -

      Returns void

    • updateTimers(elapsedTime: number): void
    • updateTimers(elapsedTime: number): void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    opacity: number = 255
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    opacity: number = 255
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Displays a text.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,67 +78,67 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -146,63 +146,63 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getCharacterSize(): number
    • getCharacterSize(): number
    • getColor(): string
    • getColor(): string
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -227,211 +227,211 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getOutlineThickness(): number
    • getOutlineThickness(): number
    • getPadding(): number
    • getPadding(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): Text
    • getRendererObject(): Text
    • getScale(): number
    • getScale(): number
    • Get the scale of the object (or the geometric mean of the X and Y scale in case they are different).

      Returns number

      the scale of the object (or the geometric mean of the X and Y scale in case they are different).

      -
    • getScaleMean(): number
    • getScaleMean(): number
    • Get the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).

      deprecated

      Use getScale instead.

      Returns number

      the scale of the object (or the arithmetic mean of the X and Y scale in case they are different).

      -
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getShadowAngle(): number
    • getShadowAngle(): number
    • getShadowBlurRadius(): number
    • getShadowBlurRadius(): number
    • getShadowDistance(): number
    • getShadowDistance(): number
    • getShadowOpacity(): number
    • getShadowOpacity(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getString(): string

    Returns number

    • getString(): string
    • getText(): string
    • getText(): string
    • getTextAlignment(): string
    • getTextAlignment(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getWrappingWidth(): number
    • getWrappingWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isBold(): boolean
    • isBold(): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isHidden(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isItalic(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isItalic(): boolean
    • isOnLayer(layer: string): boolean
    • isOnLayer(layer: string): boolean
    • isOutlineEnabled(): boolean
    • isShadowEnabled(): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isOutlineEnabled(): boolean
    • isShadowEnabled(): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -440,45 +440,45 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • isWrapping(): boolean
    • isWrapping(): boolean
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -489,7 +489,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -498,7 +498,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -524,7 +524,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    opacity: number = 255
    persistentUuid: null | string = null
    +
    opacity: number = 255
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • Parameters

      • instanceContainer: RuntimeInstanceContainer

        The container the object belongs to.

      • textObjectData: TextObjectData

        The initial properties of the object

        diff --git a/GDJS Runtime Documentation/classes/gdjs.TileMap.TileMapCollisionMaskRenderer.html b/GDJS Runtime Documentation/classes/gdjs.TileMap.TileMapCollisionMaskRenderer.html index 5519f035e..514204c29 100644 --- a/GDJS Runtime Documentation/classes/gdjs.TileMap.TileMapCollisionMaskRenderer.html +++ b/GDJS Runtime Documentation/classes/gdjs.TileMap.TileMapCollisionMaskRenderer.html @@ -1,7 +1,7 @@ TileMapCollisionMaskRenderer | GDevelop JavaScript game engine
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Legend

        • Constructor
        • Method

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        A tile map transformed with an affine transformation.

        see

        getHitboxesAround It gives a fast access to hitboxes for collision handling.

        -

        Hierarchy

        • TransformedCollisionTileMap

        Index

        Constructors

        Hierarchy

        • TransformedCollisionTileMap

        Index

        Constructors

        Methods

        • getAllHitboxes(tag: string): Iterable<Polygon>

        Methods

        • getAllHitboxes(tag: string): Iterable<Polygon>
        • getDimensionX(): number
        • getDimensionY(): number
        • getHeight(): number
        • getHitboxes(tag: string, xMin: number, yMin: number, xMax: number, yMax: number): Iterable<Polygon>
        • getDimensionX(): number
        • getDimensionY(): number
        • getHeight(): number
        • getHitboxes(tag: string, xMin: number, yMin: number, xMax: number, yMax: number): Iterable<Polygon>
        • getHitboxesAround(tag: string, left: number, top: number, right: number, bottom: number): Iterable<Polygon>
        • getHitboxesAround(tag: string, left: number, top: number, right: number, bottom: number): Iterable<Polygon>
        • see

          {@link gdjs.RuntimeObject.getHitboxesAround}

          Parameters

          • tag: string

            The tile tag.

          • left: number
            @@ -34,19 +34,19 @@

            The left border of the area in the scene.

          Returns Iterable<Polygon>

          At least all the hitboxes from the given area where tiles have the right tag.

          -
        • getTileDefinition(tileId: number): undefined | TileDefinition
        • getTileDefinition(tileId: number): undefined | TileDefinition
        • getTileHeight(): number
        • getTileWidth(): number
        • getTileHeight(): number
        • getTileWidth(): number
        • getWidth(): number
        • pointIsInsideTile(x: number, y: number, tag: string): boolean
        • getWidth(): number
        • pointIsInsideTile(x: number, y: number, tag: string): boolean

        Returns boolean

        true when the point is inside a tile with a given tag.

        -

    Properties

    tag: string
    workingPoint: FloatPoint = ...
    +

    Returns void

    Properties

    tag: string
    workingPoint: FloatPoint = ...

    An reusable Point to avoid allocations.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A tile map layer transformed with an affine transformation.

    -

    Hierarchy

    • TransformedCollisionTileMapLayer

    Index

    Constructors

    Hierarchy

    • TransformedCollisionTileMapLayer

    Index

    Constructors

    Methods

    • get(x: number, y: number): undefined | TransformedCollisionTile

    Methods

    • get(x: number, y: number): undefined | TransformedCollisionTile
    • getAllHitboxes(tag: string): Iterable<Polygon>
    • getAllHitboxes(tag: string): Iterable<Polygon>
    • getDimensionX(): number
    • getDimensionX(): number
    • getDimensionY(): number
    • getDimensionY(): number
    • getHeight(): number
    • getHitboxes(tag: string, xMin: number, yMin: number, xMax: number, yMax: number): Iterable<Polygon>
    • getHeight(): number
    • getHitboxes(tag: string, xMin: number, yMin: number, xMax: number, yMax: number): Iterable<Polygon>
    • getWidth(): number
    • isFlippedDiagonally(x: number, y: number): boolean
    • getWidth(): number
    • isFlippedDiagonally(x: number, y: number): boolean
    • isFlippedHorizontally(x: number, y: number): boolean
    • isFlippedHorizontally(x: number, y: number): boolean
    • isFlippedVertically(x: number, y: number): boolean
    • isFlippedVertically(x: number, y: number): boolean

    Properties

    +

    Properties

    The time map that contains this layer.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    An object that handle hitboxes for a tile map.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,68 +78,68 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: any): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: any): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -147,57 +147,57 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getDebugMode(): boolean
    • getDebugMode(): boolean
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getFillColor(): number
    • getFillOpacity(): number
    • getHeight(): number

    Returns number

    • getFillColor(): number
    • getFillOpacity(): number
    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>

    Parameters

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -

    Returns number

    Returns number

    Returns number

    Returns number

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Displays a Tilemap object (mapeditor.org supported).

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,68 +78,68 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: any): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: any): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number
    • getAnimationFps(): number
    • getAnimationSpeedScale(): number

    Returns number

    • getAnimationFps(): number
    • getAnimationSpeedScale(): number
    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -147,59 +147,59 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getDisplayMode(): string
    • getDisplayMode(): string
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -224,179 +224,179 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getLayerIndex(): number
    • getLevelIndex(): number
    • getName(): string
    • getLayerIndex(): number
    • getLevelIndex(): number
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): CompositeTilemap
    • getRendererObject(): CompositeTilemap
    • getScale(): number
    • getScale(): number
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTilemapJsonFile(): string
    • getTilesetJsonFile(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTilemapJsonFile(): string
    • getTilesetJsonFile(): string
    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getY(): number

    Returns number

    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getZOrder(): number

    Returns number

    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isDisplayMode(selectedDisplayMode: string): boolean
    • isEffectEnabled(name: string): boolean
    • isDisplayMode(selectedDisplayMode: string): boolean
    • isEffectEnabled(name: string): boolean
    • isHidden(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTilemapJsonFile(selectedTilemapJsonFile: string): boolean
    • isTilesetJsonFile(selectedTilesetJsonFile: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTilemapJsonFile(selectedTilemapJsonFile: string): boolean
    • isTilesetJsonFile(selectedTilesetJsonFile: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -405,43 +405,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -452,7 +452,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -461,7 +461,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -487,7 +487,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    persistentUuid: null | string = null
    +
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The PIXI.js renderer for the Tile map runtime object.

    -

    Hierarchy

    • TileMapRuntimeObjectPixiRenderer

    Index

    Constructors

    Hierarchy

    • TileMapRuntimeObjectPixiRenderer

    Index

    Constructors

    Methods

    • destroy(): void
    • getHeight(): number
    • getRendererObject(): CompositeTilemap
    • getScaleX(): number
    • getScaleY(): number
    • getTileMapHeight(): number
    • getTileMapWidth(): number
    • getWidth(): number
    • setHeight(height: number): void
    • setScaleX(scaleX: number): void
    • setScaleY(scaleY: number): void
    • setWidth(width: number): void
    • updateAngle(): void
    • updateOpacity(): void
    • updatePixiTileMap(tileMap: EditableTileMap, textureCache: TileTextureCache): void
    • updatePosition(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The TiledSpriteRuntimeObject displays a tiled texture.

    -

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void

    Hierarchy

    Implements

    Index

    Methods

    Properties

    Constructors

    Methods

    • activateBehavior(name: string, enable: boolean): void
    • addEffect(effectData: EffectData): boolean

    Returns void

    • addEffect(effectData: EffectData): boolean
    • addForce(x: number, y: number, multiplier: number): void

    Returns boolean

    • addForce(x: number, y: number, multiplier: number): void
    • Add a force to the object to move it.

      Parameters

      • x: number

        The x coordinates of the force

        @@ -18,7 +18,7 @@

        The y coordinates of the force

      • multiplier: number

        Set the force multiplier

        -

      Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void

    Returns void

    • addForceTowardObject(object: null | RuntimeObject, len: number, multiplier: number): void
    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void

    Returns void

    • addForceTowardPosition(x: number, y: number, len: number, multiplier: number): void
    • addNewBehavior(behaviorData: BehaviorData): boolean

    Returns void

    • addNewBehavior(behaviorData: BehaviorData): boolean
    • Create the behavior described by the given BehaviorData

      Parameters

      • behaviorData: BehaviorData

        The data to be used to construct the behavior.

      Returns boolean

      true if the behavior was properly created, false otherwise.

      -
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • addPolarForce(angle: number, len: number, multiplier: number): void
    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns void

    • averageForceAngleIs(angle: number, toleranceInDegrees: number): boolean

    Returns boolean

    true if the difference between the average angle of the forces and the angle parameter is inferior to toleranceInDegrees parameter.

    -
    • behaviorActivated(name: string): boolean
    • behaviorActivated(name: string): boolean
    • clearEffects(): boolean
    • clearEffects(): boolean
    • clearForces(): void
    • clearForces(): void
    • Return true if the hitboxes of two objects are overlapping

      static

      Parameters

      • obj1: RuntimeObject

        The first runtimeObject

        @@ -78,67 +78,67 @@
      • ignoreTouchingEdges: boolean

        If true, then edges that are touching each other, without the hitbox polygons actually overlapping, won't be considered in collision.

      Returns boolean

      true if obj1 and obj2 are in collision

      -

    Returns void

    • enableEffect(name: string, enable: boolean): void
    • enableEffect(name: string, enable: boolean): void
    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void

    Returns void

    • extraInitializationFromInitialInstance(initialInstanceData: InstanceData): void
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • get3DRendererObject(): undefined | null | Object3D<Object3DEventMap>
    • Get the AABB (axis aligned bounding box) for the object.

      The default implementation uses either the position/size of the object (when angle is 0) or hitboxes (when angle is not 0) to compute the bounding box. Result is cached until invalidated (by a position change, angle change...).

      You should probably redefine updateAABB instead of this function.

      Returns AABB

      The bounding box

      -
    • getAABBBottom(): number
    • getAABBBottom(): number
    • getAABBCenterX(): number
    • getAABBCenterX(): number
    • getAABBCenterY(): number
    • getAABBCenterY(): number
    • getAABBLeft(): number
    • getAABBLeft(): number
    • getAABBRight(): number
    • getAABBRight(): number
    • getAABBTop(): number
    • getAABBTop(): number
    • getAngle(): number
    • getAngle(): number
    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • getAngleToPosition(targetX: number, targetY: number): number

    Returns number

    • Get a behavior from its name. If the behavior does not exists, undefined is returned.

      Never keep a reference to a behavior, as they can be hot-reloaded. Instead, @@ -146,62 +146,62 @@

      Parameters

      • name: string

        The behavior name.

      Returns null | RuntimeBehavior

      The behavior with the given name, or undefined.

      -
    • getCenterX(): number
    • getCenterX(): number
    • Return the X position of the object center, relative to the object X position (getDrawableX). Use getCenterXInScene to get the position of the center in the scene.

      Returns number

      the X position of the object center, relative to getDrawableX().

      -
    • getCenterXInScene(): number
    • getCenterXInScene(): number
    • getCenterY(): number
    • getCenterY(): number
    • Return the Y position of the object center, relative to the object position (getDrawableY). Use getCenterYInScene to get the position of the center in the scene.

      Returns number

      the Y position of the object center, relative to getDrawableY().

      -
    • getCenterYInScene(): number
    • getCenterYInScene(): number
    • getColor(): string
    • getColor(): string
    • getDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getDistanceToPosition(targetX: number, targetY: number): number
    • getDrawableX(): number

    Returns number

    • getDrawableX(): number
    • Get the X position of the rendered object.

      For most objects, this will returns the same value as getX(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableX will differ.

      Returns number

      The X position of the rendered object.

      -
    • getDrawableY(): number
    • getDrawableY(): number
    • Get the Y position of the rendered object.

      For most objects, this will returns the same value as getY(). But if the object has an origin that is not the same as the point (0,0) of the object displayed, getDrawableY will differ.

      Returns number

      The Y position of the rendered object.

      -
    • getHeight(): number

    Returns number

    • getHeight(): number
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • getHitBoxesAround(left: number, top: number, right: number, bottom: number): Iterable<Polygon>
    • Return at least all the hit boxes that overlap a given area.

      The hit boxes don't need to actually overlap the area, (i.e: it's correct to return more hit boxes than those in the specified area) @@ -226,183 +226,183 @@

    • bottom: number

      bound of the area in scene coordinates

    Returns Iterable<Polygon>

    at least all the hit boxes that overlap a given area.

    -
    • getLayer(): string
    • getLayer(): string
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNameIdentifier(name: string): number
    • getNameIdentifier(name: string): number
    • 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.

      -
      static

      Parameters

      • name: string

      Returns number

    • getOpacity(): number
    • getOpacity(): number
    • getRendererEffects(): Record<string, Filter>
    • getRendererEffects(): Record<string, Filter>
    • getRendererObject(): TilingSprite
    • getRendererObject(): TilingSprite
    • getScale(): number
    • getScale(): number
    • getScaleX(): number
    • getScaleX(): number
    • getScaleY(): number
    • getScaleY(): number
    • getSqDistanceToPosition(targetX: number, targetY: number): number

    Returns number

    • getSqDistanceToPosition(targetX: number, targetY: number): number
    • getTimerElapsedTimeInSeconds(timerName: string): number

    Returns number

    • getTimerElapsedTimeInSeconds(timerName: string): number
    • Get a timer elapsed time.

      This is used by expressions to return 0 when a timer doesn't exist because numeric expressions must always return a number.

      Parameters

      • timerName: string

        The timer name.

      Returns number

      The timer elapsed time in seconds, 0 if the timer doesn't exist.

      -
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getTimerElapsedTimeInSecondsOrNaN(timerName: string): number
    • getUniqueId(): number
    • getUniqueId(): number
    • Get the unique identifier of the object.
      The identifier is set by the runtimeScene owning the object.
      You can also use the id property (this._object.id) for increased efficiency instead of calling this method.

      Returns number

      The object identifier

      -
    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • getVisibilityAABB(): null | AABB
    • getVisibilityAABB(): null | AABB
    • Get the AABB (axis aligned bounding box) to be used to determine if the object is visible on screen. The gdjs.RuntimeScene will hide the renderer object if the object is not visible on screen ("culling").

      The default implementation uses the AABB returned by getAABB.

      If null is returned, the object is assumed to be always visible.

      Returns null | AABB

      The bounding box or null.

      -
    • getWidth(): number
    • getWidth(): number
    • getX(): number
    • getX(): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • getXFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getXOffset(): number

    Returns number

    • getXOffset(): number
    • getY(): number
    • getY(): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • getYFromAngleAndDistance(angle: number, distance: number): number
    • 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.

      Parameters

      • angle: number

        The angle, in degrees.

      • distance: number

        The distance from the object, in pixels

        -

      Returns number

    • getYOffset(): number

    Returns number

    • getYOffset(): number
    • getZOrder(): number
    • getZOrder(): number
    • hasBehavior(name: string): boolean
    • hasBehavior(name: string): boolean
    • hasEffect(name: string): boolean

    Returns boolean

    • hasEffect(name: string): boolean
    • hasNoForces(): boolean
    • hasNoForces(): boolean
    • hasVariable(name: string): boolean
    • hasVariable(name: string): boolean
    • hide(enable: boolean): void
    • hide(enable: boolean): void
    • insideObject(x: number, y: number): boolean

    Returns void

    • insideObject(x: number, y: number): boolean
    • Return true if the specified position is inside object bounding box.

      The position should be in "world" coordinates, i.e use gdjs.Layer.convertCoords if you need to pass the mouse or a touch position that you get from gdjs.InputManager. To check if a point is inside the object collision mask, you can use isCollidingWithPoint instead.

      -

      Parameters

      • x: number
      • y: number

      Returns boolean

    • invalidateHitboxes(): void
    • invalidateHitboxes(): void
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isCollidingWithPoint(pointX: number, pointY: number): boolean
    • isEffectEnabled(name: string): boolean
    • isEffectEnabled(name: string): boolean
    • isHidden(): boolean
    • isHidden(): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isIncludedInParentCollisionMask(): boolean
    • isOnLayer(layer: string): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • isTotalForceAngleAround(angle: number, toleranceInDegrees: number): boolean
    • Return true if the angle of the total force applied on the object is in a given range.

      Parameters

      • angle: number
        @@ -411,43 +411,43 @@

        The maximum distance from the given angle.

      Returns boolean

      true if the difference between the force angle the given angle is less or equals the toleranceInDegrees.

      -
    • isVisible(): boolean
    • isVisible(): boolean
    • Return true if the object is not hidden.

      Note: This is unrelated to the actual visibility of the object on the screen. For this, see getVisibilityAABB to get the bounding boxes of the object as displayed on the scene.

      Returns boolean

      true if the object is not hidden.

      -
    • notifyBehaviorsObjectHotReloaded(): void
    • notifyBehaviorsObjectHotReloaded(): void
    • onCreated(): void
    • onCreated(): void
    • To be called by the child classes in their constructor, at the very end. Notify the behaviors that they have been constructed (this must be done when the object is ready, otherwise behaviors can do operations on the object which could be not initialized yet).

      If you redefine this function, make sure to call the original method (RuntimeObject.prototype.onCreated.call(this);).

      -

      Returns void

    • onDestroyed(): void

    Returns void

    • onDestroyed(): void

    Returns void

    • pauseTimer(timerName: string): void

    Returns void

    • pauseTimer(timerName: string): void
    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void

    Returns void

    • putAround(x: number, y: number, distance: number, angleInDegrees: number): void
    • Put the object around a position, with a specific distance and angle. The distance and angle are computed between the position and the center of the object.

      Parameters

      • x: number
        @@ -458,7 +458,7 @@

        The distance between the object and the target, in pixels.

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void

    Returns void

    • putAroundObject(obj: null | RuntimeObject, distance: number, angleInDegrees: number): void
    • Put the object around another object, with a specific distance and angle. The distance and angle are computed between the centers of the objects.

      Parameters

      • obj: null | RuntimeObject
        @@ -467,7 +467,7 @@

        The distance between the object and the target

      • angleInDegrees: number

        The angle between the object and the target, in degrees.

        -

      Returns void

    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • raycastTest(x: number, y: number, endX: number, endY: number, closest: boolean): RaycastTestResult
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • registerDestroyCallback(callback: () => void): void
    • reinitialize(objectData: ObjectData): void
    • Called to reset the object to its default state. This is used for objects that are "recycled": they are dismissed (at which point onDestroyFromScene is called) but still stored in a cache to be reused next time an object must be created. At this point, @@ -493,7 +493,7 @@

    • The _runtimeScene, _nameId, name and type are guaranteed to stay the same and do not need to be set again.
    -

    Parameters

    Returns void

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns boolean

    Returns boolean

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns void

    Returns boolean

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []
    +

    Returns void

    Properties

    angle: number = 0
    forcesGarbage: Force[] = []

    Global container for unused forces, avoiding recreating forces each tick.

    -
    static
    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

    getFirstVariableNumber: (array: Variable) => number = RuntimeObject.getFirstVariableNumber

    Type declaration

      • Shortcut to get the first value of an array variable as a number.

        -

        Parameters

        Returns number

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

    getFirstVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

    getFirstVariableString: (array: Variable) => string = RuntimeObject.getFirstVariableString

    Type declaration

      • Shortcut to get the first value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

    getLastVariableNumber: (array: Variable) => number = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

    getLastVariableNumber: (array: Variable) => number = RuntimeObject.getLastVariableNumber

    Type declaration

      • Shortcut to get the last value of an array variable as a number.

        -

        Parameters

        Returns number

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

    getLastVariableString: (array: Variable) => string = ...

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

    getLastVariableString: (array: Variable) => string = RuntimeObject.getLastVariableString

    Type declaration

      • Shortcut to get the last value of an array variable as a string.

        -

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • +

        Parameters

        Returns string

    getSqDistanceTo: (targetX: number, targetY: number) => number = RuntimeObject.prototype.getSqDistanceToPosition

    Type declaration

      • (targetX: number, targetY: number): number
      • Get the squared distance, in pixels, between the center of this object and a position.

        Parameters

        • targetX: number

          Target X position

        • targetY: number

          Target Y position

          -

        Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns number

    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = RuntimeObject.getVariableBoolean

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • +

        Parameters

        Returns boolean

    getVariableChildCount: (variable: Variable) => number = RuntimeObject.getVariableChildCount

    Type declaration

      • Get the number of children from a variable

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The number of children

        -
    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

    getVariableNumber: (variable: Variable) => number = RuntimeObject.getVariableNumber

    Type declaration

      • Get the value of a variable considered as a number. Equivalent of variable.getAsNumber()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns number

        The value of the specified variable

        -
    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

    getVariableString: (variable: Variable) => string = RuntimeObject.getVariableString

    Type declaration

      • Get the value of a variable considered as a string. Equivalent of variable.getAsString()

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns string

        The string of the specified variable

        -
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null
    +
    hidden: boolean = false
    id: number
    layer: string = ''
    name: string
    networkId: null | string = null

    A network ID associated to the object to be used for multiplayer, to identify the object across peers. We don't use persistentUuid as it's only used for hot-reload. We don't use the object ID either as it's not unique across peers.

    -
    opacity: number = 255
    persistentUuid: null | string = null
    +
    opacity: number = 255
    persistentUuid: null | string = null

    An optional UUID associated to the object to be used for hot reload. Don't modify or use otherwise.

    -
    pick: boolean = false
    +
    pick: boolean = false

    A property to be used by external algorithms to indicate if the object is picked or not in an object selection. By construction, this is not "thread safe" or "re-entrant algorithm" safe.

    -
    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

    returnVariable: (variable: Variable) => Variable = RuntimeObject.returnVariable

    Type declaration

      • Return the variable passed as argument without any change. Only for usage by events.

        static

        Parameters

        • variable: Variable

          The variable to be accessed

        Returns Variable

        The specified variable

        -
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +
    setVariableBoolean: (variable: Variable, newValue: boolean) => void = RuntimeObject.setVariableBoolean

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • +

      Returns void

    setVariableNumber: (variable: Variable, newValue: number) => void = RuntimeObject.setVariableNumber

    Type declaration

      • (variable: Variable, newValue: number): void
      • Shortcut to set the value of a variable considered as a number

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: number

          The value to be set

          -

        Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • +

      Returns void

    setVariableString: (variable: Variable, newValue: string) => void = RuntimeObject.setVariableString

    Type declaration

      • (variable: Variable, newValue: string): void
      • Shortcut to set the value of a variable considered as a string

        Parameters

        • variable: Variable

          The variable to be changed

        • newValue: string

          The value to be set

          -

        Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • +

      Returns void

    supportsReinitialization: boolean = false
    toggleVariableBoolean: (variable: Variable) => void = RuntimeObject.toggleVariableBoolean

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    type: string
    valuePush: (array: Variable, value: string | number | boolean) => void = RuntimeObject.valuePush

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable
          +

          Parameters

          • array: Variable
          • value: string | number | boolean

          Returns void

    variableChildExists: (variable: Variable, childName: string) => boolean = RuntimeObject.variableChildExists

    Type declaration

      • (variable: Variable, childName: string): boolean
      • static

        Parameters

        • variable: Variable

          The variable to be tested

        • childName: string

          The name of the child

          -

        Returns boolean

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

    variableClearChildren: (variable: Variable) => void = RuntimeObject.variableClearChildren

    Type declaration

      • static

        Parameters

        • variable: Variable

          The variable to be cleared

          -

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = RuntimeObject.variablePushCopy

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = RuntimeObject.variableRemoveAt

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

    variableRemoveChild: (variable: Variable, childName: string) => void = RuntimeObject.variableRemoveChild

    Type declaration

      • (variable: Variable, childName: string): void
      • static

        Parameters

        • variable: Variable

          The variable to be changed

        • childName: string

          The name of the child

          -

        Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • +

      Returns void

    x: number = 0
    y: number = 0
    zOrder: number = 0
    aabb: AABB = ...
    hitBoxes: Polygon[]
    hitBoxesDirty: boolean = true
    getVariableBoolean: (variable: Variable, compareWith: boolean) => boolean = ...

    Type declaration

      • (variable: Variable, compareWith: boolean): boolean
      • Shortcut to compare the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        -

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • +

        Parameters

        Returns boolean

    setVariableBoolean: (variable: Variable, newValue: boolean) => void = ...

    Type declaration

      • (variable: Variable, newValue: boolean): void
      • Shortcut to set the value of a variable considered as a boolean. This shortcut function is needed for events code generation.

        Parameters

        Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • +

      Returns void

    toggleVariableBoolean: (variable: Variable) => void = ...

    Type declaration

      • Toggles a variable. This shortcut function is needed for events code generation.

        see

        {gdjs.evtTools.common.toggleVariableBoolean}

        -

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • +

        Parameters

        Returns void

    valuePush: (array: Variable, value: string | number | boolean) => void = ...

    Type declaration

      • (array: Variable, value: string | number | boolean): void
      • This shortcut function is needed for events code generation.

        -

        Parameters

        • array: Variable
        • value: string | number | boolean

        Returns void

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

    variablePushCopy: (array: Variable, variable: Variable) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

    variableRemoveAt: (array: Variable, index: number) => void = ...

    Type declaration

      • This shortcut function is needed for events code generation.

        -

        Parameters

        Returns void

    Constructors

    Constructors

    • Parameters

      • instanceContainer: RuntimeInstanceContainer

        The container the object belongs to.

      • tiledSpriteObjectData: TiledSpriteObjectData

        The initial properties of the object

        diff --git a/GDJS Runtime Documentation/classes/gdjs.TimeManager.html b/GDJS Runtime Documentation/classes/gdjs.TimeManager.html index 4f8e1c2c2..cfd6ab26d 100644 --- a/GDJS Runtime Documentation/classes/gdjs.TimeManager.html +++ b/GDJS Runtime Documentation/classes/gdjs.TimeManager.html @@ -2,24 +2,24 @@

        Manage the timers and times elapsed during last frame, since the beginning of the scene and other time related values. All durations are expressed in milliseconds.

        -

    Hierarchy

    • TimeManager

    Index

    Methods

    • addTimer(name: string): void
    • getElapsedTime(): number

    Hierarchy

    • TimeManager

    Index

    Methods

    • addTimer(name: string): void
    • getElapsedTime(): number
    • Return the time elapsed since the last call to update (i.e: the last frame), in milliseconds.

      -

      Returns number

    • getTimeFromStart(): number
    • getTimeFromStart(): number
    • Get the time since the instantiation of the manager (i.e: since the beginning of the scene most of the time), in milliseconds.

      -

      Returns number

    • getTimeScale(): number
    • getTimeScale(): number
    • getTimer(name: string): Timer
    • hasTimer(name: string): boolean
    • isFirstFrame(): boolean
    • getTimer(name: string): Timer
    • hasTimer(name: string): boolean
    • isFirstFrame(): boolean
    • Return true if update was called only once (i.e: if the scene is rendering its first frame).

      -

      Returns boolean

    • removeTimer(name: string): void
    • reset(): void
    • setTimeScale(timeScale: number): void
    • removeTimer(name: string): void
    • reset(): void
    • setTimeScale(timeScale: number): void
    • Set the time scale: time will be slower if time scale is < 1, faster if > 1.

      Parameters

      • timeScale: number

        The new time scale (must be positive).

        -

      Returns void

    • update(elapsedTime: number, minimumFPS: number): void

    Constructors

    Legend

    • Constructor
    • Method

    Settings

    Theme

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Represents a timer, which must be updated manually with gdjs.Timer.updateTime.

    -

    Hierarchy

    • Timer

    Index

    Constructors

    • new Timer(name: string): Timer

    Hierarchy

    • Timer

    Index

    Constructors

    • new Timer(name: string): Timer

    Methods

    • getName(): string

    Returns Timer

    Methods

    • getName(): string
    • getNetworkSyncData(): TimerNetworkSyncData
    • getTime(): number
    • getNetworkSyncData(): TimerNetworkSyncData
    • getTime(): number
    • Get the time of the timer, in milliseconds.

      Returns number

      The time of the timer, in milliseconds.

      -
    • isPaused(): boolean
    • isPaused(): boolean
    • reset(): void
    • reset(): void
    • setPaused(enable: boolean): void
    • setPaused(enable: boolean): void
    • Set if the timer is paused.

      Parameters

      • enable: boolean

        true to pause the timer, false otherwise.

        -

      Returns void

    • setTime(time: number): void

    Returns void

    • setTime(time: number): void
    • Change the time.

      Parameters

      • time: number

        The new time, in milliseconds.

        -

      Returns void

    • updateFromNetworkSyncData(syncData: TimerNetworkSyncData): void
    • updateTime(time: number): void

    Returns void

    • updateFromNetworkSyncData(syncData: TimerNetworkSyncData): void
    • updateTime(time: number): void
    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: any, newBehaviorData: any): boolean
    • usesLifecycleFunction(): boolean
    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Properties

    name: string
    type: string

    Legend

    • Constructor
    • Method
    • Inherited property
    • Inherited method

    Settings

    Theme

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Methods

    • activate(enable: boolean): void
    • activated(): boolean
    • addColorEffectPropertyTween(effectBehavior: any, identifier: string, toColorStr: string, effectName: string, propertyName: string, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • addColorEffectPropertyTween(effectBehavior: any, identifier: string, toColorStr: string, effectName: string, propertyName: string, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween a color object effect property.

      Parameters

      • effectBehavior: any

        Only used by events can be set to null

        @@ -22,7 +22,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addNumberEffectPropertyTween(effectBehavior: any, identifier: string, toValue: number, effectName: string, propertyName: string, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addNumberEffectPropertyTween(effectBehavior: any, identifier: string, toValue: number, effectName: string, propertyName: string, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween a numeric object effect property.

      Parameters

      • effectBehavior: any

        Only used by events can be set to null

        @@ -40,7 +40,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectAngleTween(identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectAngleTween(identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object angle.

      deprecated

      Use addObjectAngleTween2 instead.

      Parameters

      • identifier: string
        @@ -53,7 +53,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectAngleTween2(identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectAngleTween2(identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object angle.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -65,7 +65,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectColorHSLTween(identifier: string, toHue: number, animateHue: boolean, toSaturation: number, toLightness: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectColorHSLTween(identifier: string, toHue: number, animateHue: boolean, toSaturation: number, toLightness: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object HSL color, with the "to" color given using HSL (H: any number, S and L: 0-100).

      deprecated

      Use addObjectColorHSLTween2 instead.

      Parameters

      • identifier: string
        @@ -82,7 +82,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectColorHSLTween2(identifier: string, toHue: number, animateHue: boolean, toSaturation: number, toLightness: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectColorHSLTween2(identifier: string, toHue: number, animateHue: boolean, toSaturation: number, toLightness: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object HSL color, with the "to" color given using HSL (H: any number, S and L: 0-100).

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -98,7 +98,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectColorTween(identifier: string, toColorStr: string, easing: string, duration: number, destroyObjectWhenFinished: boolean, useHSLColorTransition: boolean): void

    Returns void

    • addObjectColorTween(identifier: string, toColorStr: string, easing: string, duration: number, destroyObjectWhenFinished: boolean, useHSLColorTransition: boolean): void
    • Tween an object color.

      deprecated

      Use addObjectColorTween2 instead.

      Parameters

      • identifier: string
        @@ -113,7 +113,7 @@

        Destroy this object when the tween ends

      • useHSLColorTransition: boolean

        Tween using HSL color mappings, rather than direct RGB line

        -

      Returns void

    • addObjectColorTween2(identifier: string, toColorStr: string, easing: string, duration: number, destroyObjectWhenFinished: boolean, useHSLColorTransition?: boolean): void

    Returns void

    • addObjectColorTween2(identifier: string, toColorStr: string, easing: string, duration: number, destroyObjectWhenFinished: boolean, useHSLColorTransition?: boolean): void
    • Tween an object color.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -127,7 +127,7 @@

        Destroy this object when the tween ends

      • useHSLColorTransition: boolean = true

        Tween using HSL color mappings, rather than direct RGB line

        -

      Returns void

    • addObjectDepthTween(identifier: string, toDepth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectDepthTween(identifier: string, toDepth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object depth.

      deprecated

      Use addObjectDepthTween2 instead.

      Parameters

      • identifier: string
        @@ -140,7 +140,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectDepthTween2(object3DBehavior: any, identifier: string, toDepth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectDepthTween2(object3DBehavior: any, identifier: string, toDepth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object depth.

      Parameters

      • object3DBehavior: any

        Only used by events can be set to null

        @@ -154,7 +154,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectHeightTween(identifier: string, toHeight: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectHeightTween(identifier: string, toHeight: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object height.

      deprecated

      Use addObjectHeightTween2 instead.

      Parameters

      • identifier: string
        @@ -167,7 +167,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectHeightTween2(identifier: string, toHeight: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectHeightTween2(identifier: string, toHeight: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object height.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -179,7 +179,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectOpacityTween(identifier: string, toOpacity: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectOpacityTween(identifier: string, toOpacity: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object opacity.

      deprecated

      Use addObjectOpacityTween2 instead.

      Parameters

      • identifier: string
        @@ -192,7 +192,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectOpacityTween2(identifier: string, toOpacity: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectOpacityTween2(identifier: string, toOpacity: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object opacity.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -204,7 +204,7 @@

        Duration in second

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionTween(identifier: string, toX: number, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionTween(identifier: string, toX: number, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object position.

      deprecated

      Use addObjectPositionTween2 instead.

      Parameters

      • identifier: string
        @@ -219,7 +219,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionTween2(identifier: string, toX: number, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionTween2(identifier: string, toX: number, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object position.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -233,7 +233,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionXTween(identifier: string, toX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionXTween(identifier: string, toX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object X position.

      deprecated

      Use addObjectPositionXTween2 instead.

      Parameters

      • identifier: string
        @@ -246,7 +246,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionXTween2(identifier: string, toX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionXTween2(identifier: string, toX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object X position.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -258,7 +258,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionYTween(identifier: string, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionYTween(identifier: string, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object Y position.

      deprecated

      Use addObjectPositionYTween2 instead.

      Parameters

      • identifier: string
        @@ -271,7 +271,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionYTween2(identifier: string, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionYTween2(identifier: string, toY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object Y position.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -283,7 +283,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionZTween(identifier: string, toZ: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionZTween(identifier: string, toZ: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object Z position.

      deprecated

      Use addObjectPositionZTween2 instead.

      Parameters

      • identifier: string
        @@ -296,7 +296,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectPositionZTween2(object3DBehavior: any, identifier: string, toZ: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectPositionZTween2(object3DBehavior: any, identifier: string, toZ: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object Z position.

      Parameters

      • object3DBehavior: any

        Only used by events can be set to null

        @@ -310,7 +310,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectRotationXTween(object3DBehavior: any, identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectRotationXTween(object3DBehavior: any, identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween a 3D object rotation X.

      Parameters

      • object3DBehavior: any

        Only used by events can be set to null

        @@ -324,7 +324,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectRotationYTween(object3DBehavior: any, identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectRotationYTween(object3DBehavior: any, identifier: string, toAngle: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween a 3D object rotation Y.

      Parameters

      • object3DBehavior: any

        Only used by events can be set to null

        @@ -338,7 +338,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectScaleTween(identifier: string, toScaleX: number, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleTween(identifier: string, toScaleX: number, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object scale.

      deprecated

      Use addObjectScaleTween2 instead.

      Parameters

      • identifier: string
        @@ -355,7 +355,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectScaleTween2(identifier: string, toScaleX: number, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleTween2(identifier: string, toScaleX: number, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object scale.

      deprecated

      Use addObjectScaleXTween2 and addObjectScaleYTween2 instead.

      Parameters

      • identifier: string
        @@ -372,7 +372,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectScaleTween3(identifier: string, toScale: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleTween3(identifier: string, toScale: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object scale.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -386,7 +386,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectScaleXTween(identifier: string, toScaleX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleXTween(identifier: string, toScaleX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object X-scale.

      deprecated

      Use addObjectScaleXTween2 instead.

      Parameters

      • identifier: string
        @@ -401,7 +401,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectScaleXTween2(identifier: string, toScaleX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleXTween2(identifier: string, toScaleX: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object X-scale.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -415,7 +415,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectScaleYTween(identifier: string, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleYTween(identifier: string, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object Y-scale.

      deprecated

      Use addObjectScaleYTween2 instead.

      Parameters

      • identifier: string
        @@ -430,7 +430,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectScaleYTween2(identifier: string, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void

    Returns void

    • addObjectScaleYTween2(identifier: string, toScaleY: number, easing: string, duration: number, destroyObjectWhenFinished: boolean, scaleFromCenterOfObject: boolean): void
    • Tween an object Y-scale.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -444,7 +444,7 @@

        Destroy this object when the tween ends

      • scaleFromCenterOfObject: boolean

        Scale the transform from the center of the object (or point that is called center), not the top-left origin

        -

      Returns void

    • addObjectWidthTween(identifier: string, toWidth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectWidthTween(identifier: string, toWidth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object width.

      deprecated

      Use addObjectWidthTween2 instead.

      Parameters

      • identifier: string
        @@ -457,7 +457,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addObjectWidthTween2(identifier: string, toWidth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addObjectWidthTween2(identifier: string, toWidth: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object width.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -469,7 +469,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addTextObjectCharacterSizeTween(identifier: string, toSize: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addTextObjectCharacterSizeTween(identifier: string, toSize: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween a text object character size.

      deprecated

      Use addTextObjectCharacterSizeTween2 instead.

      Parameters

      • identifier: string
        @@ -482,7 +482,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addTextObjectCharacterSizeTween2(identifier: string, toSize: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addTextObjectCharacterSizeTween2(identifier: string, toSize: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween a text object character size.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -494,7 +494,7 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addValueTween(identifier: string, fromValue: number, toValue: number, easing: string, duration: number, useExponentialInterpolation: boolean, destroyObjectWhenFinished: boolean): void

    Returns void

    • addValueTween(identifier: string, fromValue: number, toValue: number, easing: string, duration: number, useExponentialInterpolation: boolean, destroyObjectWhenFinished: boolean): void
    • Add an object value tween.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -511,7 +511,7 @@ It's useful for values that are factors like a scale or a zoom.

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addVariableTween(identifier: string, variable: Variable, fromValue: number, toValue: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addVariableTween(identifier: string, variable: Variable, fromValue: number, toValue: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
  • destroyObjectWhenFinished: boolean

    Destroy this object when the tween ends

    -
  • Returns void

    • addVariableTween2(identifier: string, variable: Variable, toValue: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addVariableTween2(identifier: string, variable: Variable, toValue: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object variable.

      deprecated

      Use addVariableTween3 instead.

      Parameters

      • identifier: string
        @@ -549,7 +549,7 @@

        Duration in milliseconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    • addVariableTween3(identifier: string, variable: Variable, toValue: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void

    Returns void

    • addVariableTween3(identifier: string, variable: Variable, toValue: number, easing: string, duration: number, destroyObjectWhenFinished: boolean): void
    • Tween an object variable.

      Parameters

      • identifier: string

        Unique id to identify the tween

        @@ -563,111 +563,111 @@

        Duration in seconds

      • destroyObjectWhenFinished: boolean

        Destroy this object when the tween ends

        -

      Returns void

    Returns void

    Returns void

    • enableSynchronization(enable: boolean): void
    • exists(identifier: string): boolean
    • enableSynchronization(enable: boolean): void
    • exists(identifier: string): boolean
    • getName(): string
    • getName(): string
    • getNameId(): number
    • getNameId(): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getProgress(identifier: string): number
    • getNetworkSyncData(): BehaviorNetworkSyncData
    • getProgress(identifier: string): number
    • getValue(identifier: string): number
    • getValue(identifier: string): number
    • hasFinished(identifier: string): boolean
    • hasFinished(identifier: string): boolean
    • isPlaying(identifier: string): boolean

    Returns boolean

    • isPlaying(identifier: string): boolean
    • isSyncedOverNetwork(): boolean
    • onActivate(): void

    Returns boolean

    • isSyncedOverNetwork(): boolean
    • onActivate(): void
    • onCreated(): void
    • onCreated(): void
    • onDeActivate(): void
    • onDeActivate(): void
    • onDestroy(): void
    • onDestroy(): void
    • 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(): void
    • onObjectHotReloaded(): void
    • pauseTween(identifier: string): void
    • pauseTween(identifier: string): void
    • removeTween(identifier: string): void

    Returns void

    • removeTween(identifier: string): void
    • resumeTween(identifier: string): void

    Returns void

    • resumeTween(identifier: string): void

    Returns void

    Returns void

    • stopTween(identifier: string, jumpToDest: boolean): void

    Returns void

    • stopTween(identifier: string, jumpToDest: boolean): void
    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean

    Returns void

    • updateFromBehaviorData(oldBehaviorData: BehaviorData, newBehaviorData: BehaviorData): boolean
    • Called when the behavior must be updated using the specified behaviorData. This is the case during hot-reload, and is only called if the behavior was modified.

      Parameters

      • oldBehaviorData: BehaviorData
      • newBehaviorData: BehaviorData

      Returns boolean

      true if the behavior was updated, false if it could not (i.e: hot-reload is not supported).

      -
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • updateFromNetworkSyncData(networkSyncData: BehaviorNetworkSyncData): void
    • usesLifecycleFunction(): boolean

    Returns void

    • usesLifecycleFunction(): boolean
    • Should return false if the behavior does not need any lifecycle function to be called. Default, hidden, "capability" behaviors set it to false. This avoids useless calls to empty lifecycle functions, which would waste CPU time (and have a sizeable impact for example when lots of static instances are living in the scene).

      -

      Returns boolean

    Constructors

    Constructors

    Properties

    name: string
    type: string

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A Variable is an object storing a value (number or a string) or children variables.

    -

    Hierarchy

    • Variable

    Index

    Methods

    • add(val: number): void

    Hierarchy

    • Variable

    Index

    Methods

    • add(val: number): void

    Returns void

    • Add a child variable with the specified name.

      If there is an existing child variable with this name, it is erased.

      Parameters

      • childName: string
        @@ -12,19 +12,19 @@
      • childVariable: Variable

        The variable to add as a child

      Returns Variable

      The variable (for chaining calls)

      -
    • castTo(newType: VariableType): void
    • castTo(newType: VariableType): void
    • Converts the variable into another type.

      Parameters

      • newType: VariableType

        The new type of the variable

        -

      Returns void

    • clearChildren(): void

    Returns void

    • clearChildren(): void
    • concatenateString(str: string): void
    • concatenateString(str: string): void
    • Concatenate the given string at the end of the variable value

      Parameters

      • str: string

        the string to append

        -

      Returns void

    Returns void

    • Deeply copies a variable into another.

      Parameters

      • source: Variable

        The source variable.

        @@ -33,133 +33,133 @@
      • Optional merge: boolean

        Should the target be merged with the source, or be an exact copy?

      Returns Variable

      The target variable.

      -
    • disableSynchronization(): void
    • div(val: number): void
    • disableSynchronization(): void
    • div(val: number): void

    Returns void

    • Unserialize a JSON string into this variable.

      This just logs an error if the JSON is invalid.

      Parameters

      • json: string

        A JSON string.

        -

      Returns Variable

    Returns Variable

    • Converts a JavaScript object into a value compatible with GDevelop variables and store it inside this variable.

      Parameters

      • obj: any

        The value to convert.

        -

      Returns Variable

    • getAllChildren(): Children

    Returns Variable

    • getAllChildren(): Children
    • Return the object containing all the children of the variable.

      Returns Children

      All the children of the variable

      -
    • getAsBoolean(): boolean
    • getAsBoolean(): boolean
    • Get the value of the variable, considered as a boolean

      Returns boolean

      The boolean value of the variable.

      -
    • getAsNumber(): number
    • getAsNumber(): number
    • Get the value of the variable, considered as a number

      Returns number

      The number stored in the variable

      -
    • getAsString(): string
    • getAsString(): string
    • Get the value of the variable, considered as a string

      Returns string

      The string stored in the variable

      -
    • getChild(childName: string | number): Variable
    • getChild(childName: string | number): Variable
    • Get the child with the specified name or at the specified index.

      If the variable is an array, prefer getChildAt. If the variable is a structure, prefer getChildNamed.

      If the variable has not the specified child, an empty variable with the specified name (or index) is added as child.

      Parameters

      • childName: string | number

      Returns Variable

      The child variable

      -
    • getChildNamed(childName: string): Variable
    • getChildNamed(childName: string): Variable
    • Get the child with the specified name.

      If the variable has not the specified child, an empty variable with the specified name is added as child.

      Parameters

      • childName: string

      Returns Variable

      The child variable

      -
    • getChildrenCount(): number
    • getChildrenCount(): number
    • getPlayerOwnership(): null | number
    • getType(): VariableType
    • getPlayerOwnership(): null | number
    • getType(): VariableType
    • getValue(): string | number | boolean
    • getValue(): string | number | boolean
    • hasChild(childName: string): boolean
    • hasChild(childName: string): boolean
    • Return the child in a variable.

      Check if the variable has the specified children

      Parameters

      • childName: string

      Returns boolean

      true if variable has the children with the specified name

      -
    • isNumber(): boolean
    • isNumber(): boolean
    • isPrimitive(type: VariableType): type is "string" | "number" | "boolean"
    • isPrimitive(type: VariableType): type is "string" | "number" | "boolean"
    • Return true if the variable type is a primitive type.

      -

      Parameters

      • type: VariableType

      Returns type is "string" | "number" | "boolean"

    • isPrimitive(): boolean
    • isPrimitive(): boolean
    • isStructure(): boolean
    • isStructure(): boolean
    • isUndefinedInContainer(): boolean
    • isUndefinedInContainer(): boolean
    • Check if the variable must be considered as not existing in its container (usually a gdjs.VariablesContainer).

      Returns boolean

      true if the container must consider that the variable does not exist.

      -
    • mul(val: number): void
    • mul(val: number): void
    • pushValue(value: string | number | boolean): void

    Returns void

    • pushValue(value: string | number | boolean): void
    • pushVariableCopy(variable: Variable): void
    • pushVariableCopy(variable: Variable): void
    • reinitialize(varData?: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>): void
    • Parameters

      • Optional varData: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>

      Returns void

    • removeAtIndex(index: number): void
    • reinitialize(varData?: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>): void
    • Parameters

      • Optional varData: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>

      Returns void

    • removeAtIndex(index: number): void
    • removeChild(childName: string): void
    • removeChild(childName: string): void
    • Remove the child with the specified name.

      If the variable has not the specified child, nothing is done.

      Parameters

      • childName: string

        The name of the child to be removed

        -

      Returns void

    • replaceChildren(newChildren: Children): void

    Returns void

    • replaceChildren(newChildren: Children): void
    • Replaces all the children with a new map of children.

      Parameters

      • newChildren: Children

        The map of new children.

        -

      Returns void

    • replaceChildrenArray(newChildren: Variable[]): void

    Returns void

    • replaceChildrenArray(newChildren: Variable[]): void
    • setBoolean(newValue: boolean): void

    Returns void

    • setBoolean(newValue: boolean): void
    • Change the value of the variable, considered as a boolean

      Parameters

      • newValue: boolean

        The new boolean to be set.

        -

      Returns void

    • setNumber(newValue: number): void

    Returns void

    • setNumber(newValue: number): void
    • Change the value of the variable, considered as a number

      Parameters

      • newValue: number

        The new value to be set

        -

      Returns void

    • setPlayerOwnership(playerNumber: number): void
    • setString(newValue: string): void

    Returns void

    • setPlayerOwnership(playerNumber: number): void
    • setString(newValue: string): void
    • Change the value of the variable, considered as a string

      Parameters

      • newValue: string

        The new string to be set

        -

      Returns void

    • setUndefinedInContainer(): void

    Returns void

    • setUndefinedInContainer(): void
    • Used (usually by gdjs.VariablesContainer) to set that the variable must be considered as not existing in the container.

      -

      Returns void

    • setValue(newValue: string | number | boolean): void
    • setValue(newValue: string | number | boolean): void
    • Sets the primitive value using the setter of the current type.

      Parameters

      • newValue: string | number | boolean

        The primitive value of the variable.

        -

      Returns void

    • sub(val: number): void

    Returns void

    • sub(val: number): void
    • Subtract the given number to the variable value

      Parameters

      • val: number

        the number to subtract

        -

      Returns void

    • toJSObject(): any

    Returns void

    • toJSObject(): any
    • Converts this variable into an equivalent JavaScript object.

      Returns any

      A JavaScript object equivalent to the variable.

      -
    • toggle(): void
    • toggle(): void
    • concatenate(str: string): void
    • getAsNumberOrString(): string | number
    • concatenate(str: string): void
    • getAsNumberOrString(): string | number
    • Get the value of the variable, as a number if it's one, or as a string (if it's a string or something else)

      In most cases, prefer calling getAsNumber or getAsString directly. This is a fallback in case a variable type can't be known statically for sure, like getValue.

      -

      Returns string | number

    Constructors

    • new Variable(varData?: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>): Variable
    • Parameters

      • Optional varData: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>

      Returns Variable

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    VariablesContainer stores variables, usually for a a RuntimeGame, a RuntimeScene or a RuntimeObject.

    -

    Hierarchy

    • VariablesContainer

    Index

    Methods

    • add(name: string, newVariable: Variable): void

    Hierarchy

    • VariablesContainer

    Index

    Methods

    • add(name: string, newVariable: Variable): void

    Returns void

    • Get a variable using its index. If you're unsure about how to use this method, prefer to use get. The index of a variable is its index in the data passed to initFrom.

      This method is generally used by events generated code to increase lookup speed for variables.

      @@ -21,17 +21,17 @@

      The variable index

    Returns Variable

    The specified variable. If not found, an empty variable is added to the container, but it should not happen.

    -
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): VariableNetworkSyncData[]
    • getStructureNetworkSyncData(variable: Variable): undefined | VariableNetworkSyncData[]
    • getVariableNameInContainerByLoopingThroughAllVariables(variable: Variable): null | string
    • has(name: string): boolean
    • getNetworkSyncData(syncOptions: GetNetworkSyncDataOptions): VariableNetworkSyncData[]
    • getStructureNetworkSyncData(variable: Variable): undefined | VariableNetworkSyncData[]
    • getVariableNameInContainerByLoopingThroughAllVariables(variable: Variable): null | string
    • has(name: string): boolean
    • hasVariable(variable: Variable): boolean
    • hasVariable(variable: Variable): boolean
    • initFrom(data: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>[], keepOldVariables?: Boolean): void
    • initFrom(data: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>[], keepOldVariables?: Boolean): void
    • Initialize variables from a container data.
      If keepOldVariables is set to false (by default), all already existing variables will be erased, but the new variables will be accessible thanks to getFromIndex.
      @@ -39,18 +39,18 @@ still accessible thanks to getFromIndex.

      Parameters

      • data: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>[]

        The array containing data used to initialize variables.

        -
      • Optional keepOldVariables: Boolean

      Returns void

    • remove(name: string): void

    Returns void

    • remove(name: string): void
    • Remove a variable. (the variable is not really removed from the container to avoid creating garbage, but marked as undefined)

      Parameters

      • name: string

        Variable to be removed

        -

      Returns void

    • updateFromNetworkSyncData(networkSyncData: VariableNetworkSyncData[]): void

    Properties

    badVariable: Variable = ...
    +

    Returns void

    • updateFromNetworkSyncData(networkSyncData: VariableNetworkSyncData[]): void

    Properties

    badVariable: Variable = ...

    "Bad" variable, used by events when no other valid variable can be found. This variable has no state and always return 0 or the empty string.

    -
    static
    badVariablesContainer: VariablesContainer = ...
    +
    static
    badVariablesContainer: VariablesContainer = ...

    "Bad" variable container, used by events when no other valid container can be found. This container has no state and always returns the bad variable ( see VariablesContainer.badVariable ).

    -
    static

    Constructors

    • new VariablesContainer(initialVariablesData?: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>[]): VariablesContainer
    • Parameters

      • Optional initialVariablesData: Readonly<{ children?: Readonly<{ name?: string | undefined; value?: string | number | boolean | undefined; children?: Readonly<...>[] | undefined; type?: VariableType | undefined; }>[]; name?: string; type?: VariableType; value?: string | number | boolean }>[]

      Returns VariablesContainer

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The PIXI.js renderer for the VideoRuntimeObject.

    -

    Hierarchy

    • VideoRuntimeObjectPixiRenderer

    Index

    Constructors

    Hierarchy

    • VideoRuntimeObjectPixiRenderer

    Index

    Constructors

    Methods

    • ensureUpToDate(): void
    • getCurrentTime(): number

    Returns VideoRuntimeObjectPixiRenderer

    Methods

    • ensureUpToDate(): void
    • getCurrentTime(): number
    • getDuration(): number
    • getDuration(): number
    • getHeight(): number
    • getPlaybackSpeed(): number
    • getHeight(): number
    • getPlaybackSpeed(): number
    • getRendererObject(): any
    • getVolume(): number
    • getRendererObject(): any
    • getVolume(): number
    • getWidth(): number
    • isEnded(): boolean
    • getWidth(): number
    • isEnded(): boolean
    • isLooped(): boolean
    • isLooped(): boolean
    • isMuted(): boolean
    • isMuted(): boolean
    • isPlayed(): boolean
    • isPlayed(): boolean
    • onDestroy(): void
    • onDestroy(): void
    • pause(): void
    • pause(): void
    • play(): void
    • play(): void
    • setCurrentTime(number: any): void
    • setCurrentTime(number: any): void
    • setHeight(height: number): void
    • setHeight(height: number): void
    • setLoop(enable: boolean): void

    Returns void

    • setLoop(enable: boolean): void
    • setMute(enable: boolean): void

    Returns void

    • setMute(enable: boolean): void
    • setPlaybackSpeed(playbackRate: any): void

    Returns void

    • setPlaybackSpeed(playbackRate: any): void
    • setVolume(volume: number): void
    • setVolume(volume: number): void
    • setWidth(width: number): void

    Returns void

    • setWidth(width: number): void
    • stop(): void

    Returns void

    • stop(): void
    • updateAngle(): void
    • updateLoop(): void
    • updateOpacity(): void
    • updatePosition(): void
    • updateVolume(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    This debugger client connects to a websocket server, exchanging and receiving messages with this server.

    -

    Hierarchy

    Index

    Methods

    • call(path: string[], args: any[]): boolean

    Hierarchy

    Index

    Methods

    • call(path: string[], args: any[]): boolean
    • log(group: string, message: string, type: "info" | "warning" | "error", internal: boolean): void
    • log(group: string, message: string, type: "info" | "warning" | "error", internal: boolean): void
    • onUncaughtException(exception: Error): void
    • sendGamePaused(): void
    • onUncaughtException(exception: Error): void
    • sendGamePaused(): void
    • sendGameResumed(): void
    • sendGameResumed(): void

    Returns void

    • sendProfilerStarted(): void

    Returns void

    • sendProfilerStarted(): void
    • sendProfilerStopped(): void
    • sendProfilerStopped(): void
    • sendRuntimeGameDump(): void
    • sendRuntimeGameDump(): void
    • set(path: string[], newValue: any): boolean
    • set(path: string[], newValue: any): boolean
    • handleCommand(data: any): void
    • handleCommand(data: any): void

    Constructors

    Properties

    hasLoggedError: boolean = false

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    This debugger client connects to the parent window, exchanging and receiving messages using postMessage and the message event listener.

    -

    Hierarchy

    Index

    Methods

    • call(path: string[], args: any[]): boolean

    Hierarchy

    Index

    Methods

    • call(path: string[], args: any[]): boolean
    • log(group: string, message: string, type: "info" | "warning" | "error", internal: boolean): void
    • log(group: string, message: string, type: "info" | "warning" | "error", internal: boolean): void
    • onUncaughtException(exception: Error): void
    • sendGamePaused(): void
    • onUncaughtException(exception: Error): void
    • sendGamePaused(): void
    • sendGameResumed(): void
    • sendGameResumed(): void

    Returns void

    • sendProfilerStarted(): void

    Returns void

    • sendProfilerStarted(): void
    • sendProfilerStopped(): void
    • sendProfilerStopped(): void
    • sendRuntimeGameDump(): void
    • sendRuntimeGameDump(): void
    • set(path: string[], newValue: any): boolean
    • set(path: string[], newValue: any): boolean
    • handleCommand(data: any): void
    • handleCommand(data: any): void

    Constructors

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    An event that can be listened to.

    -

    Hierarchy

    • Event

    Implements

    Index

    Constructors

    Properties

    dataloss: boolean = false
    data: IEventData[] = []

    Methods

    • getData(): string

    Hierarchy

    • Event

    Implements

    Index

    Constructors

    Properties

    dataloss: boolean = false
    data: IEventData[] = []

    Methods

    • getData(): string
    • getSender(): string
    • getSender(): string
    • isTriggered(): boolean
    • isTriggered(): boolean
    • popData(): void
    • popData(): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    The data bound to an event that got triggered.

    -

    Hierarchy

    • EventData

    Implements

    Index

    Constructors

    Properties

    Constructors

    • new EventData(data: string, sender: string): EventData

    Properties

    data: string = ''
    +

    Hierarchy

    • EventData

    Implements

    Index

    Constructors

    Properties

    Constructors

    • new EventData(data: string, sender: string): EventData

    Properties

    data: string = ''

    The data sent alongside the event.

    -
    sender: string = ''
    +
    sender: string = ''

    The ID of the sender of the event.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    Index

    Constructors

    Methods

    Properties

    Constructors

    • new WaitTask(durationInMilliseconds: number): WaitTask

    Methods

    • setAnimationName(newAnimationName: string): void
    • setAnimationSpeedScale(ratio: number): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Abstraction from graphic libraries texture classes.

    -

    Type parameters

    • T

    Hierarchy

    • AnimationFrameTextureManager

    Index

    Methods

    • getAnimationFrameHeight(pixiTexture: T): any
    • getAnimationFrameTexture(imageName: string): T
    • getAnimationFrameWidth(pixiTexture: T): any

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Hierarchy

    • Base3DHandler

    Implemented by

    Index

    Methods

    • flipZ(enable: boolean): void
    • getCenterZInScene(): number
    • setDepth(depth: number): void
    • setRotationX(angle: number): void
    • setRotationX(angle: number): void
    • Set the object rotation on the X axis.

      This is an Euler angle. Objects use the ZYX order.

      Parameters

      • angle: number

        the rotation angle on the X axis in degree

        -

      Returns void

    • setRotationY(angle: number): void

    Returns void

    • setRotationY(angle: number): void
    • Set the object rotation on the Y axis.

      This is an Euler angle. Objects use the ZYX order.

      Parameters

      • angle: number

        the rotation angle on the Y axis in degree

        -

      Returns void

    • setScaleZ(newScale: number): void

    Returns void

    • setScaleZ(newScale: number): void
    • Change the scale on Z axis of the object (changing its depth).

      Parameters

      • newScale: number

        The new scale (must be greater than 0).

        -

      Returns void

    • setZ(z: number): void

    Returns void

    • setZ(z: number): void
    • turnAroundX(deltaAngle: number): void
    • turnAroundX(deltaAngle: number): void
    • Turn the object around the scene X axis at its center.

      Parameters

      • deltaAngle: number

        the rotation angle in degree

        -

      Returns void

    • turnAroundY(deltaAngle: number): void

    Returns void

    • turnAroundY(deltaAngle: number): void
    • Turn the object around the scene Y axis at its center.

      Parameters

      • deltaAngle: number

        the rotation angle in degree

        -

      Returns void

    • turnAroundZ(deltaAngle: number): void

    Returns void

    • turnAroundZ(deltaAngle: number): void
    • setEffectDoubleParameter(name: string, parameterName: string, value: number): boolean
    • Change an effect property value (for properties that are numbers).

      Parameters

      • name: string

        The name of the effect to update.

        @@ -25,7 +25,7 @@

        The name of the property to update.

      • value: number

        The new value (number).

        -

      Returns boolean

    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean

    Returns boolean

    • setEffectStringParameter(name: string, parameterName: string, value: string): boolean
    • signInWithProvider(providerName: ProviderName, callbackStateVariable?: Variable): void
    • token(): string

    Returns void

    • token(): string

    Variables

    authenticated: boolean = false
    +

    Returns string

    Variables

    authenticated: boolean = false

    The current authentication status.

    -
    currentUser: firebase.User | null = null
    +
    currentUser: firebase.User | null = null

    The logged-in users data.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Contains dangerous management functions. Requires reauthentication before usage.

    -
    namespace

    Index

    Functions

    • changeEmail(oldEmail: string, password: string, newEmail: string, sendVerificationEmail?: boolean, callbackStateVariable?: Variable): void

    Index

    Functions

    • changeEmail(oldEmail: string, password: string, newEmail: string, sendVerificationEmail?: boolean, callbackStateVariable?: Variable): void
    • Changes the users email. Use this when using basic auth.

      Parameters

      • oldEmail: string
        @@ -9,14 +9,14 @@

        Old password for reauthentication.

      • newEmail: string

        New email for the user.

        -
      • sendVerificationEmail: boolean = true
      • Optional callbackStateVariable: Variable

      Returns void

    • changeEmailProvider(newEmail: string, sendVerificationEmail: boolean, callbackStateVariable?: Variable): void

    Returns void

    • changeEmailProvider(newEmail: string, sendVerificationEmail: boolean, callbackStateVariable?: Variable): void
    • Changes the users email. Use this when using an external provider.

      Parameters

      • newEmail: string

        New email for the user.

      • sendVerificationEmail: boolean

        Send a verification email to the old address before changing the email?

        -
      • Optional callbackStateVariable: Variable

      Returns void

    • changePassword(email: string, oldPassword: string, newPassword: string, callbackStateVariable?: Variable): void

    Returns void

    • changePassword(email: string, oldPassword: string, newPassword: string, callbackStateVariable?: Variable): void
    • changePasswordProvider(newPassword: string, callbackStateVariable?: Variable): void

    Returns void

    • changePasswordProvider(newPassword: string, callbackStateVariable?: Variable): void
    • deleteUser(email: string, password: string, callbackStateVariable?: Variable): void

    Returns void

    • deleteUser(email: string, password: string, callbackStateVariable?: Variable): void
    • deleteUserProvider(callbackStateVariable?: Variable): void

    Returns void

    • deleteUserProvider(callbackStateVariable?: Variable): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A namespace containing tools for managing the current user.

    -
    namespace

    Index

    Functions

    • getCreationTime(): string

    Index

    Functions

    • getCreationTime(): string
    • getDisplayName(): string
    • getDisplayName(): string
    • getEmail(): string
    • getEmail(): string
    • getLastLoginTime(): string
    • getLastLoginTime(): string
    • getPhoneNumber(): string
    • getPhoneNumber(): string
    • getPhotoURL(): string
    • getPhotoURL(): string
    • getRefreshToken(): string
    • getRefreshToken(): string
    • getTenantID(): string
    • getTenantID(): string
    • getUID(): string
    • getUID(): string
    • isEmailVerified(): boolean
    • isEmailVerified(): boolean
    • sendVerificationEmail(): Promise<void> | ""
    • sendVerificationEmail(): Promise<void> | ""
    • setDisplayName(newDisplayName: string): Promise<void>
    • setDisplayName(newDisplayName: string): Promise<void>
    • setPhotoURL(newPhotoURL: string): Promise<void>
    • setPhotoURL(newPhotoURL: string): Promise<void>

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Firebase Cloud database Event Tools.

    -
    namespace

    Index

    Functions

    • deleteField(path: string, field: string, callbackStateVariable?: Variable): void

    Index

    Functions

    • deleteField(path: string, field: string, callbackStateVariable?: Variable): void
    • deleteVariable(path: string, callbackStateVariable?: Variable): void

    Returns void

    • deleteVariable(path: string, callbackStateVariable?: Variable): void
    • getField(path: string, field: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • getField(path: string, field: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void
    • Gets a field of a database variable and store it in a variable.

      Parameters

      • path: string

        The name under which the variable will be saved (document name).

        @@ -18,13 +18,13 @@

        The field to get.

      • callbackValueVariable: Variable

        The variable where to store the result.

        -
      • Optional callbackStateVariable: Variable

      Returns void

    • getVariable(path: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • getVariable(path: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void
    • hasField(path: string, field: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • hasField(path: string, field: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void
    • hasVariable(path: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • hasVariable(path: string, callbackValueVariable: Variable, callbackStateVariable?: Variable): void
    • updateField(path: string, field: string, value: string | number, callbackStateVariable?: Variable): void

    Returns void

    • updateField(path: string, field: string, value: string | number, callbackStateVariable?: Variable): void
    • Updates a field of a database variable.

      Parameters

      • path: string

        The name under which the variable will be saved (document name).

        @@ -46,13 +46,13 @@

        The field where to update.

      • value: string | number

        The value to write.

        -
      • Optional callbackStateVariable: Variable

      Returns void

    • updateVariable(path: string, variable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • updateVariable(path: string, variable: Variable, callbackStateVariable?: Variable): void
    • writeField(path: string, field: string, value: string | number, callbackStateVariable?: Variable): void

    Returns void

    • writeField(path: string, field: string, value: string | number, callbackStateVariable?: Variable): void
    • writeVariable(path: string, variable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • writeVariable(path: string, variable: Variable, callbackStateVariable?: Variable): void
    • deleteDocument(collectionName: string, documentName: string, callbackStateVariable?: Variable): void
    • deleteField(collectionName: string, documentName: string, field: string, callbackStateVariable?: Variable): void

    Returns void

    • deleteField(collectionName: string, documentName: string, field: string, callbackStateVariable?: Variable): void
    • executeQuery(queryID: string, callbackValueVariable?: Variable, callbackStatusVariable?: Variable): void

    Returns void

    • executeQuery(queryID: string, callbackValueVariable?: Variable, callbackStatusVariable?: Variable): void
    • getDocument(collectionName: string, documentName: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void

    Returns void

    • getDocument(collectionName: string, documentName: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void
    • getField(collectionName: string, documentName: string, field: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void

    Returns void

    • getField(collectionName: string, documentName: string, field: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void
    • getServerTimestamp(): string

    Returns void

    • getServerTimestamp(): string
    • hasDocument(collectionName: string, documentName: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void
    • hasDocument(collectionName: string, documentName: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void
    • hasField(collectionName: string, documentName: string, field: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void

    Returns void

    • hasField(collectionName: string, documentName: string, field: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void
    • listDocuments(collectionName: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void

    Returns void

    • listDocuments(collectionName: string, callbackValueVariable?: Variable, callbackStateVariable?: Variable): void
    • queryLimit(queryID: string, amount: number, last: boolean): void

    Returns void

    • queryLimit(queryID: string, amount: number, last: boolean): void
    • Limits the amount of documents returned by the query.

      Parameters

      • queryID: string

        The query to add the filter to.

        @@ -67,7 +67,7 @@

        The amount of documents to limit to

      • last: boolean

        If true, limits to the last documents instead of the first documents.

        -

      Returns void

    • queryOrderBy(queryID: string, field: string, direction: OrderByDirection): void

    Returns void

    • queryOrderBy(queryID: string, field: string, direction: OrderByDirection): void
    • querySkipSome(queryID: string, value: number, before: boolean, includeSelf: boolean): void

    Returns void

    • querySkipSome(queryID: string, value: number, before: boolean, includeSelf: boolean): void
    • Makes a query skip documents after or before a certain value of a field the query was ordered with.

      Parameters

      • queryID: string
        @@ -86,7 +86,7 @@

        If set to true, all documents before the document are skipped, else all documents after it are skipped.

      • includeSelf: boolean

        If set to true, doesn't skip the document.

        -

      Returns void

    • queryWhere(queryID: string, field: string, op: "<" | "<=" | "==" | "!=" | ">=" | ">" | "array-contains", value: string | number): void

    Returns void

    • queryWhere(queryID: string, field: string, op: "<" | "<=" | "==" | "!=" | ">=" | ">" | "array-contains", value: string | number): void
    • startQuery(queryID: string, collectionName: string): void

    Returns void

    • startQuery(queryID: string, collectionName: string): void
    • startQueryFrom(queryID: string, sourceQueryID: string): void

    Returns void

    • startQueryFrom(queryID: string, sourceQueryID: string): void
    • updateDocument(collectionName: string, variableName: string, variable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • updateDocument(collectionName: string, variableName: string, variable: Variable, callbackStateVariable?: Variable): void
    • updateField(collectionName: string, documentName: string, field: string, value: any, callbackStateVariable?: Variable): void

    Returns void

    • updateField(collectionName: string, documentName: string, field: string, value: any, callbackStateVariable?: Variable): void
    • watchQuery(queryID: string, callbackValueVariable?: Variable, callbackStatusVariable?: Variable): void

    Returns void

    • watchQuery(queryID: string, callbackValueVariable?: Variable, callbackStatusVariable?: Variable): void
    • writeDocument(collectionName: string, variableName: string, variable: Variable, callbackStateVariable?: Variable): void

    Returns void

    • writeDocument(collectionName: string, variableName: string, variable: Variable, callbackStateVariable?: Variable): void
    • writeField(collectionName: string, documentName: string, field: string, value: any, callbackStateVariable?: Variable, merge?: boolean): void

    Returns void

    • writeField(collectionName: string, documentName: string, field: string, value: any, callbackStateVariable?: Variable, merge?: boolean): void
    • stopTracer(tracerName: string): void
    • uploadFile(uploadID: string, file: string, onlinePath: string, type?: "none" | "base64" | "base64url" | "data_url", callbackStateVariable?: Variable, callbackValueVariable?: Variable): void
    • Uploads a file as string to the firebase storage bucket.

      Parameters

      • uploadID: string
      • file: string

        The entire file as string.

      • onlinePath: string

        The path under which the file will be accessible on the bucket.

        -
      • Optional type: "none" | "base64" | "base64url" | "data_url"
      • Optional callbackStateVariable: Variable
      • Optional callbackValueVariable: Variable

      Returns void

    Variables

    uploads: Map<string, UploadTask> = ...
    +
  • Optional type: "none" | "base64" | "base64url" | "data_url"
  • Optional callbackStateVariable: Variable
  • Optional callbackValueVariable: Variable
  • Returns void

    Variables

    uploads: Map<string, UploadTask> = ...

    The map containing all current uploads.

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    • getLastEndedTouchId(): number
    • getLastTouchId(): number

    Variables

    keysNameToCode: { Add: number; Back: number; BackSlash: number; Comma: number; Dash: number; Delete: number; Divide: number; Down: number; End: number; Equal: number; Escape: number; F1: number; F10: number; F11: number; F12: number; F2: number; F3: number; F4: number; F5: number; F6: number; F7: number; F8: number; F9: number; Home: number; Insert: number; LAlt: number; LBracket: number; LControl: number; LShift: number; LSystem: number; Left: number; Menu: number; Multiply: number; Num0: number; Num1: number; Num2: number; Num3: number; Num4: number; Num5: number; Num6: number; Num7: number; Num8: number; Num9: number; Numpad0: number; Numpad1: number; Numpad2: number; Numpad3: number; Numpad4: number; Numpad5: number; Numpad6: number; Numpad7: number; Numpad8: number; Numpad9: number; NumpadAdd: number; NumpadDivide: number; NumpadDown: number; NumpadEnd: number; NumpadHome: number; NumpadLeft: number; NumpadMultiply: number; NumpadPageDown: number; NumpadPageUp: number; NumpadReturn: number; NumpadRight: number; NumpadSubtract: number; NumpadUp: number; PageDown: number; PageUp: number; Pause: number; Period: number; Quote: number; RAlt: number; RBracket: number; RControl: number; RShift: number; RSystem: number; Return: number; Right: number; SemiColon: number; Slash: number; Space: number; Subtract: number; Tab: number; Tilde: number; Up: number; a: number; b: number; c: number; d: number; e: number; f: number; g: number; h: number; i: number; j: number; k: number; l: number; m: number; n: number; o: number; p: number; q: number; r: number; s: number; t: number; u: number; v: number; w: number; x: number; y: number; z: number } = ...

    Hashmap associated each name of a key to its location-aware keyCode.

    memberof

    gdjs.evtTools

    -

    Type declaration

    • Add: number
    • Back: number
    • BackSlash: number
    • Comma: number
    • Dash: number
    • Delete: number
    • Divide: number
    • Down: number
    • End: number
    • Equal: number
    • Escape: number
    • F1: number
    • F10: number
    • F11: number
    • F12: number
    • F2: number
    • F3: number
    • F4: number
    • F5: number
    • F6: number
    • F7: number
    • F8: number
    • F9: number
    • Home: number
    • Insert: number
    • LAlt: number
    • LBracket: number
    • LControl: number
    • LShift: number
    • LSystem: number
    • Left: number
    • Menu: number
    • Multiply: number
    • Num0: number
    • Num1: number
    • Num2: number
    • Num3: number
    • Num4: number
    • Num5: number
    • Num6: number
    • Num7: number
    • Num8: number
    • Num9: number
    • Numpad0: number
    • Numpad1: number
    • Numpad2: number
    • Numpad3: number
    • Numpad4: number
    • Numpad5: number
    • Numpad6: number
    • Numpad7: number
    • Numpad8: number
    • Numpad9: number
    • NumpadAdd: number
    • NumpadDivide: number
    • NumpadDown: number
    • NumpadEnd: number
    • NumpadHome: number
    • NumpadLeft: number
    • NumpadMultiply: number
    • NumpadPageDown: number
    • NumpadPageUp: number
    • NumpadReturn: number
    • NumpadRight: number
    • NumpadSubtract: number
    • NumpadUp: number
    • PageDown: number
    • PageUp: number
    • Pause: number
    • Period: number
    • Quote: number
    • RAlt: number
    • RBracket: number
    • RControl: number
    • RShift: number
    • RSystem: number
    • Return: number
    • Right: number
    • SemiColon: number
    • Slash: number
    • Space: number
    • Subtract: number
    • Tab: number
    • Tilde: number
    • Up: number
    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number
    • g: number
    • h: number
    • i: number
    • j: number
    • k: number
    • l: number
    • m: number
    • n: number
    • o: number
    • p: number
    • q: number
    • r: number
    • s: number
    • t: number
    • u: number
    • v: number
    • w: number
    • x: number
    • y: number
    • z: number
    lastEndedTouchId: number = 0
    deprecated
    lastTouchId: number = 0
    deprecated
    mouseButtonsNameToCode: { Back: number; Forward: number; Left: number; Middle: number; Right: number } = ...
    +

    Type declaration

    • Add: number
    • Back: number
    • BackSlash: number
    • Comma: number
    • Dash: number
    • Delete: number
    • Divide: number
    • Down: number
    • End: number
    • Equal: number
    • Escape: number
    • F1: number
    • F10: number
    • F11: number
    • F12: number
    • F2: number
    • F3: number
    • F4: number
    • F5: number
    • F6: number
    • F7: number
    • F8: number
    • F9: number
    • Home: number
    • Insert: number
    • LAlt: number
    • LBracket: number
    • LControl: number
    • LShift: number
    • LSystem: number
    • Left: number
    • Menu: number
    • Multiply: number
    • Num0: number
    • Num1: number
    • Num2: number
    • Num3: number
    • Num4: number
    • Num5: number
    • Num6: number
    • Num7: number
    • Num8: number
    • Num9: number
    • Numpad0: number
    • Numpad1: number
    • Numpad2: number
    • Numpad3: number
    • Numpad4: number
    • Numpad5: number
    • Numpad6: number
    • Numpad7: number
    • Numpad8: number
    • Numpad9: number
    • NumpadAdd: number
    • NumpadDivide: number
    • NumpadDown: number
    • NumpadEnd: number
    • NumpadHome: number
    • NumpadLeft: number
    • NumpadMultiply: number
    • NumpadPageDown: number
    • NumpadPageUp: number
    • NumpadReturn: number
    • NumpadRight: number
    • NumpadSubtract: number
    • NumpadUp: number
    • PageDown: number
    • PageUp: number
    • Pause: number
    • Period: number
    • Quote: number
    • RAlt: number
    • RBracket: number
    • RControl: number
    • RShift: number
    • RSystem: number
    • Return: number
    • Right: number
    • SemiColon: number
    • Slash: number
    • Space: number
    • Subtract: number
    • Tab: number
    • Tilde: number
    • Up: number
    • a: number
    • b: number
    • c: number
    • d: number
    • e: number
    • f: number
    • g: number
    • h: number
    • i: number
    • j: number
    • k: number
    • l: number
    • m: number
    • n: number
    • o: number
    • p: number
    • q: number
    • r: number
    • s: number
    • t: number
    • u: number
    • v: number
    • w: number
    • x: number
    • y: number
    • z: number
    lastEndedTouchId: number = 0
    deprecated
    lastTouchId: number = 0
    deprecated
    mouseButtonsNameToCode: { Back: number; Forward: number; Left: number; Middle: number; Right: number } = ...

    A hashmap associates each name of a mouse button with its respective code.

    memberof

    gdjs.evtTools

    Type declaration

    • Back: number
    • Forward: number
    • Left: number
    • Middle: number
    • Right: number

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    • displayLeaderboard(runtimeScene: RuntimeScene, leaderboardId: string, displayLoader: boolean): Promise<void>
    • formatPlayerName(rawName?: null | string): string
    • getLastSaveError(leaderboardId?: string): null | string
    • hasBeenSaved(leaderboardId?: string): boolean
    • hasPlayerJustClosedLeaderboardView(): boolean
    • +leaderboards | GDevelop JavaScript game engine
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Functions

      • displayLeaderboard(runtimeScene: RuntimeScene, leaderboardId: string, displayLoader: boolean): Promise<void>
      • formatPlayerName(rawName?: null | string): string
      • getLastSaveError(leaderboardId?: string): null | string
      • hasBeenSaved(leaderboardId?: string): boolean
      • hasPlayerJustClosedLeaderboardView(): boolean
      • hasSavingErrored(leaderboardId?: string): boolean
      • isLeaderboardViewErrored(): boolean
      • isLeaderboardViewLoaded(): boolean
      • isLeaderboardViewLoading(): boolean
      • isSaving(leaderboardId?: string): boolean
      • savePlayerScore(runtimeScene: RuntimeScene, leaderboardId: string, score: number, playerName: string): PromiseTask<void>
      • setPreferSendConnectedPlayerScore(runtimeScene: RuntimeScene, enable: boolean): void

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Functions

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Functions

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Functions

      • jsonToVariableStructure(jsonStr: string, variable: Variable): void
      • sendAwaitableAsyncRequest(url: string, body: string, method: string, contentType: string, responseVar: Variable, errorVar: Variable): PromiseTask<void>
      • sendDeprecatedSynchronousRequest(host: any, uri: any, body: any, method: any, contentType: any, responseVar: any): void
      • variableStructureToJSON(variable: Variable): string

      Returns void

    • sendAwaitableAsyncRequest(url: string, body: string, method: string, contentType: string, responseVar: Variable, errorVar: Variable): PromiseTask<void>
    • sendDeprecatedSynchronousRequest(host: any, uri: any, body: any, method: any, contentType: any, responseVar: any): void
    • variableStructureToJSON(variable: Variable): string
    • forceUseRelayServer(shouldUseRelayServer: boolean): void
    • Forces the usage of a relay (TURN) server, to avoid sharing IP addresses with the other peers.

      Parameters

      • shouldUseRelayServer: boolean

        Whether relay-only should be enabled or disabled.

        -

      Returns void

    • getConnectedPeer(): string

    Returns void

    • getConnectedPeer(): string
    • getConnectionInstance(peerID: string): undefined | DataConnection<NetworkEvent>
    • getConnectionInstance(peerID: string): undefined | DataConnection<NetworkEvent>
    • A JavaScript-only function to get the raw P2P DataConnection. This can be useful for example when you want to use a binary protocol instead of GDevelop variables for high-performance networking.

      -

      Parameters

      • peerID: string

      Returns undefined | DataConnection<NetworkEvent>

    • getCurrentId(): string
    • getCurrentId(): string
    • getDisconnectedPeer(): string
    • getDisconnectedPeer(): string
    • getEvent(name: string): IEvent
    • getEvent(name: string): IEvent
    • getEventData(eventName: string): string
    • getEventData(eventName: string): string
    • Get some data associated to the last trigger of an event.

      Parameters

      • eventName: string

        The event to get data from.

      Returns string

      • The data as JSON.
      -
    • getEventSender(eventName: string): string
    • getEventSender(eventName: string): string
    • Get the id of peer that caused the last trigger of an event.

      Parameters

      • eventName: string

        The event to get the sender from.

        -

      Returns string

    • getEventVariable(eventName: string, variable: Variable): void

    Returns string

    • getEventVariable(eventName: string, variable: Variable): void
    • Get a variable associated to the last trigger of an event.

      Parameters

      • eventName: string

        The event to get the variable from.

      • variable: Variable

        The variable where to store the variable content.

        -

      Returns void

    • getLastError(): string

    Returns void

    • getLastError(): string
    • isReady(): boolean
    • isReady(): boolean
    • onConnection(): boolean
    • onConnection(): boolean
    • onDisconnect(): boolean
    • onDisconnect(): boolean
    • onError(): boolean
    • onError(): boolean
    • onEvent(eventName: string, defaultDataLoss: boolean): boolean
    • onEvent(eventName: string, defaultDataLoss: boolean): boolean
    • Returns true when the event got triggered by another p2p client.

      Parameters

      • eventName: string
      • defaultDataLoss: boolean

        Is data loss allowed (accelerates event handling when true)?

        -

      Returns boolean

    • overrideId(id: string): void

    Returns boolean

    • overrideId(id: string): void
    • Overrides the default peer ID. Must be called before connecting to a broker. Overriding the ID may have unwanted consequences. Do not use this feature unless you really know what you are doing.

      Parameters

      • id: string

        The peer ID to use when connecting to a broker.

        -

      Returns void

    • sendDataTo(id: string, eventName: string, eventData: string): void

    Returns void

    • sendDataTo(id: string, eventName: string, eventData: string): void
    • Send an event to one specific connected client.

      Parameters

      • id: string

        The ID of the client to send the event to.

      • eventName: string

        The event to trigger.

        -
      • eventData: string

      Returns void

    • sendDataToAll(eventName: string, eventData: string): void

    Returns void

    • sendDataToAll(eventName: string, eventData: string): void
    • Send an event to all connected clients.

      Parameters

      • eventName: string

        The event to trigger.

        -
      • eventData: string

      Returns void

    • sendVariableTo(id: string, eventName: string, variable: Variable): void

    Returns void

    • sendVariableTo(id: string, eventName: string, variable: Variable): void
    • Send an event to one specific connected client.

      Parameters

      • id: string

        The ID of the client to send the event to.

        @@ -87,13 +87,13 @@

        The event to trigger.

      • variable: Variable

        Additional variable to send with the event.

        -

      Returns void

    • sendVariableToAll(eventName: string, variable: Variable): void

    Returns void

    • sendVariableToAll(eventName: string, variable: Variable): void
    • Send an event to all connected clients.

      Parameters

      • eventName: string

        The event to trigger.

      • variable: Variable

        Additional variable to send with the event.

        -

      Returns void

    • useCustomBrokerServer(host: string, port: number, path: string, key: string, ssl: boolean): void

    Returns void

    • useCustomBrokerServer(host: string, port: number, path: string, key: string, ssl: boolean): void
    • Connects to a custom broker server.

      Parameters

      • host: string

        The host of the broker server.

        @@ -105,7 +105,7 @@

        Optional password to connect to the broker server.

      • ssl: boolean

        Use ssl?

        -

      Returns void

    • useCustomICECandidate(urls: string, username?: string, credential?: string): void

    Returns void

    • useCustomICECandidate(urls: string, username?: string, credential?: string): void
    • Adds an ICE server candidate, and removes the default ones provided by PeerJs. Must be called before connecting to a broker.

      Parameters

      • urls: string

        The URL of the STUN/TURN server.

        @@ -113,7 +113,7 @@

        An optional username to send to the server.

      • Optional credential: string

        An optional password to send to the server.

        -

      Returns void

    • useDefaultBrokerServer(): void

    Returns void

    • useDefaultBrokerServer(): void
    • Use default broker server. This is not recommended for published games, this server should only be used for quick testing in development.

      diff --git a/GDJS Runtime Documentation/modules/gdjs.evtTools.platform.html b/GDJS Runtime Documentation/modules/gdjs.evtTools.platform.html index 2f813341f..5923f8107 100644 --- a/GDJS Runtime Documentation/modules/gdjs.evtTools.platform.html +++ b/GDJS Runtime Documentation/modules/gdjs.evtTools.platform.html @@ -1,4 +1,4 @@ -platform | GDevelop JavaScript game engine
      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Settings

      Theme

      Generated using TypeDoc

      Options
      All
      • Public
      • Public/Protected
      • All
      Menu

      Index

      Functions

      • areSceneAssetsLoaded(runtimeScene: RuntimeScene, sceneName: string): boolean
      • +runtimeScene | GDevelop JavaScript game engine
        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Functions

        • areSceneAssetsLoaded(runtimeScene: RuntimeScene, sceneName: string): boolean
        • createObjectsFromExternalLayout(scene: RuntimeInstanceContainer, externalLayout: string, xPos: number, yPos: number, zPos: number): void
        • doesSceneExist(runtimeScene: RuntimeScene, sceneName: string): boolean
        • createObjectsFromExternalLayout(scene: RuntimeInstanceContainer, externalLayout: string, xPos: number, yPos: number, zPos: number): void
        • doesSceneExist(runtimeScene: RuntimeScene, sceneName: string): boolean
        • getSceneLoadingProgress(runtimeScene: RuntimeScene, sceneName: string): number
        • getTimeFromStartInSeconds(runtimeScene: RuntimeScene): number
        • getTimerElapsedTimeInSeconds(runtimeScene: RuntimeScene, timerName: string): number
        • getSceneLoadingProgress(runtimeScene: RuntimeScene, sceneName: string): number
        • getTimeFromStartInSeconds(runtimeScene: RuntimeScene): number
        • getTimerElapsedTimeInSeconds(runtimeScene: RuntimeScene, timerName: string): number
        • This is used by expressions to return 0 when a timer doesn't exist, because numeric expressions must always return a number.

          Parameters

          • runtimeScene: RuntimeScene
            @@ -11,7 +11,7 @@
          • timerName: string

            The timer name.

          Returns number

          The timer elapsed time in seconds or 0 if the timer doesn't exist.

          -
        • getTimerElapsedTimeInSecondsOrNaN(runtimeScene: RuntimeScene, timerName: string): number
        • getTimerElapsedTimeInSecondsOrNaN(runtimeScene: RuntimeScene, timerName: string): number
        • This is used by conditions to return false when a timer doesn't exist, no matter the relational operator.

          Parameters

          • runtimeScene: RuntimeScene
            @@ -19,11 +19,11 @@
          • timerName: string

            The timer name.

          Returns number

          The timer elapsed time in seconds or NaN if the timer doesn't exist.

          -
        • pauseTimer(runtimeScene: RuntimeScene, timerName: string): void
        • prioritizeLoadingOfScene(runtimeScene: RuntimeScene, sceneName: string): void
        • pauseTimer(runtimeScene: RuntimeScene, timerName: string): void
        • prioritizeLoadingOfScene(runtimeScene: RuntimeScene, sceneName: string): void
        • pushScene(runtimeScene: RuntimeScene, newSceneName: string): void
        • removeTimer(runtimeScene: RuntimeScene, timerName: string): void
        • replaceScene(runtimeScene: RuntimeScene, newSceneName: string, clearOthers: boolean): void
        • resetTimer(runtimeScene: RuntimeScene, timerName: string): void
        • setBackgroundColor(runtimeScene: RuntimeScene, rgbColor: string): void
        • setTimeScale(runtimeScene: RuntimeScene, timeScale: number): void
        • timerElapsedTime(runtimeScene: RuntimeScene, timeInSeconds: number, timerName: string): boolean
        • pushScene(runtimeScene: RuntimeScene, newSceneName: string): void
        • removeTimer(runtimeScene: RuntimeScene, timerName: string): void
        • replaceScene(runtimeScene: RuntimeScene, newSceneName: string, clearOthers: boolean): void
        • resetTimer(runtimeScene: RuntimeScene, timerName: string): void
        • setBackgroundColor(runtimeScene: RuntimeScene, rgbColor: string): void
        • setTimeScale(runtimeScene: RuntimeScene, timeScale: number): void
        • timerElapsedTime(runtimeScene: RuntimeScene, timeInSeconds: number, timerName: string): boolean
        • Test a timer elapsed time, if the timer doesn't exist it is created.

          deprecated

          prefer using getTimerElapsedTimeInSecondsOrNaN

          Parameters

          • runtimeScene: RuntimeScene
            @@ -33,7 +33,7 @@
          • timerName: string

            The timer name

          Returns boolean

          True if the timer exists and its value is greater than or equal than the given time, false otherwise

          -
        • timerPaused(runtimeScene: RuntimeScene, timerName: string): boolean
        • unpauseTimer(runtimeScene: RuntimeScene, timerName: string): void

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Functions

        • buildClient(instanceContainer: RuntimeInstanceContainer, name: string, domain: string, appId: string, accessToken: string): void
        • getCheckoutUrlForProduct(instanceContainer: RuntimeInstanceContainer, name: string, productId: string, quantity: number, variantIndex: number, successVariable: Variable, errorVariable: Variable): void

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Functions

        • buildClient(instanceContainer: RuntimeInstanceContainer, name: string, domain: string, appId: string, accessToken: string): void
        • getCheckoutUrlForProduct(instanceContainer: RuntimeInstanceContainer, name: string, productId: string, quantity: number, variantIndex: number, successVariable: Variable, errorVariable: Variable): void

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Functions

        • continueMusicOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • continueSoundOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • fadeMusicVolume(runtimeScene: RuntimeScene, channel: number, toVolume: number, timeOfFade: number): void
        • fadeSoundVolume(runtimeScene: RuntimeScene, channel: number, toVolume: number, timeOfFade: number): void
        • getMusicOnChannelPitch(runtimeScene: RuntimeScene, channel: number): number
        • getMusicOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number): number
        • getMusicOnChannelVolume(runtimeScene: RuntimeScene, channel: number): number
        • getSoundOnChannelPitch(runtimeScene: RuntimeScene, channel: number): number
        • getSoundOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number): number
        • getSoundOnChannelVolume(runtimeScene: RuntimeScene, channel: number): number
        • isMusicOnChannelPaused(runtimeScene: RuntimeScene, channel: number): boolean
        • isMusicOnChannelPlaying(runtimeScene: RuntimeScene, channel: number): boolean
        • isMusicOnChannelStopped(runtimeScene: RuntimeScene, channel: number): boolean
        • isSoundOnChannelPaused(runtimeScene: RuntimeScene, channel: number): boolean
        • isSoundOnChannelPlaying(runtimeScene: RuntimeScene, channel: number): boolean
        • isSoundOnChannelStopped(runtimeScene: RuntimeScene, channel: number): boolean
        • pauseMusicOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • pauseSoundOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • playMusic(runtimeScene: RuntimeScene, soundFile: string, loop: boolean, volume: number, pitch: number): void
        • playMusicOnChannel(runtimeScene: RuntimeScene, soundFile: string, channel: number, loop: boolean, volume: number, pitch: number): void
        • playSound(runtimeScene: RuntimeScene, soundFile: string, loop: boolean, volume: number, pitch: number): void
        • playSoundOnChannel(runtimeScene: RuntimeScene, soundFile: string, channel: number, loop: boolean, volume: number, pitch: number): void
        • preloadMusic(runtimeScene: RuntimeScene, soundFile: string): void
        • preloadSound(runtimeScene: RuntimeScene, soundFile: string): void
        • setGlobalVolume(runtimeScene: RuntimeScene, globalVolume: number): void
        • setMusicOnChannelPitch(runtimeScene: RuntimeScene, channel: number, pitch: number): void
        • setMusicOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number, playingOffset: number): void
        • setMusicOnChannelVolume(runtimeScene: RuntimeScene, channel: number, volume: number): void
        • setSoundOnChannelPitch(runtimeScene: RuntimeScene, channel: number, pitch: number): void
        • setSoundOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number, playingOffset: number): void
        • setSoundOnChannelVolume(runtimeScene: RuntimeScene, channel: number, volume: number): void
        • stopMusicOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • stopSoundOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • unloadMusic(runtimeScene: RuntimeScene, soundFile: string): void
        • unloadSound(runtimeScene: RuntimeScene, soundFile: string): void

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Functions

        • continueMusicOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • continueSoundOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • fadeMusicVolume(runtimeScene: RuntimeScene, channel: number, toVolume: number, timeOfFade: number): void
        • fadeSoundVolume(runtimeScene: RuntimeScene, channel: number, toVolume: number, timeOfFade: number): void
        • getMusicOnChannelPitch(runtimeScene: RuntimeScene, channel: number): number
        • getMusicOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number): number
        • getMusicOnChannelVolume(runtimeScene: RuntimeScene, channel: number): number
        • getSoundOnChannelPitch(runtimeScene: RuntimeScene, channel: number): number
        • getSoundOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number): number
        • getSoundOnChannelVolume(runtimeScene: RuntimeScene, channel: number): number
        • isMusicOnChannelPaused(runtimeScene: RuntimeScene, channel: number): boolean
        • isMusicOnChannelPlaying(runtimeScene: RuntimeScene, channel: number): boolean
        • isMusicOnChannelStopped(runtimeScene: RuntimeScene, channel: number): boolean
        • isSoundOnChannelPaused(runtimeScene: RuntimeScene, channel: number): boolean
        • isSoundOnChannelPlaying(runtimeScene: RuntimeScene, channel: number): boolean
        • isSoundOnChannelStopped(runtimeScene: RuntimeScene, channel: number): boolean
        • pauseMusicOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • pauseSoundOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • playMusic(runtimeScene: RuntimeScene, soundFile: string, loop: boolean, volume: number, pitch: number): void
        • playMusicOnChannel(runtimeScene: RuntimeScene, soundFile: string, channel: number, loop: boolean, volume: number, pitch: number): void
        • playSound(runtimeScene: RuntimeScene, soundFile: string, loop: boolean, volume: number, pitch: number): void
        • playSoundOnChannel(runtimeScene: RuntimeScene, soundFile: string, channel: number, loop: boolean, volume: number, pitch: number): void
        • preloadMusic(runtimeScene: RuntimeScene, soundFile: string): void
        • preloadSound(runtimeScene: RuntimeScene, soundFile: string): void
        • setGlobalVolume(runtimeScene: RuntimeScene, globalVolume: number): void
        • setMusicOnChannelPitch(runtimeScene: RuntimeScene, channel: number, pitch: number): void
        • setMusicOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number, playingOffset: number): void
        • setMusicOnChannelVolume(runtimeScene: RuntimeScene, channel: number, volume: number): void
        • setSoundOnChannelPitch(runtimeScene: RuntimeScene, channel: number, pitch: number): void
        • setSoundOnChannelPlayingOffset(runtimeScene: RuntimeScene, channel: number, playingOffset: number): void
        • setSoundOnChannelVolume(runtimeScene: RuntimeScene, channel: number, volume: number): void
        • stopMusicOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • stopSoundOnChannel(runtimeScene: RuntimeScene, channel: number): void
        • unloadMusic(runtimeScene: RuntimeScene, soundFile: string): void
        • unloadSound(runtimeScene: RuntimeScene, soundFile: string): void

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Tools related to strings manipulation, for events generated code.

        -

        Index

        Functions

        • fromCodePoint(codePoint: any): string

        Index

        Functions

        • fromCodePoint(codePoint: any): string
        • newLine(): string
        • newLine(): string
        • strAt(str: string, start: number): string
        • strAt(str: string, start: number): string
        • strFind(str: string, what: string): number
        • strFind(str: string, what: string): number
        • Search the first occurrence in a string (return the position of the result, from the beginning of the string, or -1 if not found)

          -

          Parameters

          • str: string
          • what: string

          Returns number

        • strFindFrom(str: string, what: string, pos: number): number
        • strFindFrom(str: string, what: string, pos: number): number
        • Search the first occurrence in a string, starting from a specified position (return the position of the result, from the beginning of the string, or -1 if not found)

          -

          Parameters

          • str: string
          • what: string
          • pos: number

          Returns number

        • strFindLast(str: string, what: string): number
        • strFindLast(str: string, what: string): number
        • Search the last occurrence in a string (return the position of the result, from the beginning of the string, or -1 if not found)

          -

          Parameters

          • str: string
          • what: string

          Returns number

        • strFindLastFrom(str: string, what: string, pos: number): number
        • strFindLastFrom(str: string, what: string, pos: number): number
        • Search the last occurrence in a string, starting from a specified position (return the position of the result, from the beginning of the string, or -1 if not found)

          -

          Parameters

          • str: string
          • what: string
          • pos: number

          Returns number

        • strLen(str: string): number
        • strLen(str: string): number
        • strRFind(str: string, what: string): number
        • strRFindFrom(str: string, what: string, pos: number): number
        • strRepeat(str: string, count: number): string
        • strRFind(str: string, what: string): number
        • strRFindFrom(str: string, what: string, pos: number): number
        • strRepeat(str: string, count: number): string
        • strReplaceAll(str: string, pattern: string, replacement: string): string
        • strReplaceAll(str: string, pattern: string, replacement: string): string
        • Return a new string with the content of str where all occurrences of pattern are replaced by replacement.

          -

          Parameters

          • str: string
          • pattern: string
          • replacement: string

          Returns string

        • strReplaceOne(str: string, pattern: string, replacement: string): string
        • strReplaceOne(str: string, pattern: string, replacement: string): string
        • Return a new string with the content of str where the first occurrence of pattern is replaced by replacement.

          -

          Parameters

          • str: string
          • pattern: string
          • replacement: string

          Returns string

        • subStr(str: string, start: number, len: number): string
        • subStr(str: string, start: number, len: number): string
        • toLowerCase(str: string): string
        • toLowerCase(str: string): string
        • toUpperCase(str: string): string
        • toUpperCase(str: string): string

        Settings

        Theme

        Generated using TypeDoc

        Options
        All
        • Public
        • Public/Protected
        • All
        Menu

        Index

        Functions

        • hasTouchScreen(): boolean
        • ease(easingValue: string, fromValue: number, toValue: number, weighting: number): number
        • Tween between 2 values according to an easing function.

          Parameters

          • easingValue: string

            Type of easing

            @@ -44,21 +44,21 @@

            End value

          • weighting: number

            from 0 to 1

            -

          Returns number

        • getProgress(runtimeScene: RuntimeScene, identifier: string): number

        Returns number

      • getProgress(runtimeScene: RuntimeScene, identifier: string): number
      • getValue(runtimeScene: RuntimeScene, identifier: string): number
      • getValue(runtimeScene: RuntimeScene, identifier: string): number
      • hslToRgb(h: number, s: number, l: number): number[]
      • pauseSceneTween(runtimeScene: RuntimeScene, id: string): void
      • removeSceneTween(runtimeScene: RuntimeScene, id: string): void
      • resumeSceneTween(runtimeScene: RuntimeScene, id: string): void
      • rgbToHsl(r: number, g: number, b: number): number[]
      • sceneTweenExists(runtimeScene: RuntimeScene, id: string): boolean
      • sceneTweenHasFinished(runtimeScene: RuntimeScene, id: string): boolean
      • sceneTweenIsPlaying(runtimeScene: RuntimeScene, id: string): boolean
      • stopSceneTween(runtimeScene: RuntimeScene, id: string, shouldGoToEnd: boolean): void
      • tweenCamera(runtimeScene: RuntimeScene, identifier: string, toX: number, toY: number, layerName: string, duration: number, easing: string): void
      • tweenCamera2(runtimeScene: RuntimeScene, identifier: string, toX: number, toY: number, layerName: string, easing: string, duration: number): void
      • hslToRgb(h: number, s: number, l: number): number[]
      • pauseSceneTween(runtimeScene: RuntimeScene, id: string): void
      • removeSceneTween(runtimeScene: RuntimeScene, id: string): void
      • resumeSceneTween(runtimeScene: RuntimeScene, id: string): void
      • rgbToHsl(r: number, g: number, b: number): number[]
      • sceneTweenExists(runtimeScene: RuntimeScene, id: string): boolean
      • sceneTweenHasFinished(runtimeScene: RuntimeScene, id: string): boolean
      • sceneTweenIsPlaying(runtimeScene: RuntimeScene, id: string): boolean
      • stopSceneTween(runtimeScene: RuntimeScene, id: string, shouldGoToEnd: boolean): void
      • tweenCamera(runtimeScene: RuntimeScene, identifier: string, toX: number, toY: number, layerName: string, duration: number, easing: string): void
      • tweenCamera2(runtimeScene: RuntimeScene, identifier: string, toX: number, toY: number, layerName: string, easing: string, duration: number): void
      • tweenCameraRotation(runtimeScene: RuntimeScene, identifier: string, toRotation: number, layerName: string, duration: number, easing: string): void
      • tweenCameraRotation2(runtimeScene: RuntimeScene, identifier: string, toRotation: number, layerName: string, easing: string, duration: number): void

      Returns void

    • tweenCameraRotation(runtimeScene: RuntimeScene, identifier: string, toRotation: number, layerName: string, duration: number, easing: string): void
    • tweenCameraRotation2(runtimeScene: RuntimeScene, identifier: string, toRotation: number, layerName: string, easing: string, duration: number): void
    • tweenCameraZoom(runtimeScene: RuntimeScene, identifier: string, toZoom: number, layerName: string, duration: number, easing: string): void
    • tweenCameraZoom2(runtimeScene: RuntimeScene, identifier: string, toZoom: number, layerName: string, easing: string, duration: number): void

    Returns void

    • tweenCameraZoom(runtimeScene: RuntimeScene, identifier: string, toZoom: number, layerName: string, duration: number, easing: string): void
    • tweenCameraZoom2(runtimeScene: RuntimeScene, identifier: string, toZoom: number, layerName: string, easing: string, duration: number): void
    • tweenColorEffectPropertyTween(runtimeScene: RuntimeScene, identifier: string, toColorStr: string, layerName: string, effectName: string, propertyName: string, easing: string, duration: number): void

    Returns void

    • tweenColorEffectPropertyTween(runtimeScene: RuntimeScene, identifier: string, toColorStr: string, layerName: string, effectName: string, propertyName: string, easing: string, duration: number): void
    • tweenNumberEffectPropertyTween(runtimeScene: RuntimeScene, identifier: string, toValue: number, layerName: string, effectName: string, propertyName: string, easing: string, duration: number): void

    Returns void

    • tweenNumberEffectPropertyTween(runtimeScene: RuntimeScene, identifier: string, toValue: number, layerName: string, effectName: string, propertyName: string, easing: string, duration: number): void
    • tweenVariableNumber(runtimeScene: RuntimeScene, identifier: string, variable: Variable, from: number, to: number, duration: number, easing: string): void

    Returns void

    • tweenVariableNumber(runtimeScene: RuntimeScene, identifier: string, variable: Variable, from: number, to: number, duration: number, easing: string): void
    • deprecated

      Use tweenVariableNumber3 instead. This function is misleading since one could think that the tween starts right at the moment this function is called whereas the value of the variable will change at the next frame only. Moreover, the variable will not start from the start value exactly since time will have passed at the moment the next frame is rendered. See https://github.com/4ian/GDevelop/issues/4270

      -

      Parameters

      • runtimeScene: RuntimeScene
      • identifier: string
      • variable: Variable
      • from: number
      • to: number
      • duration: number
      • easing: string

      Returns void

    • tweenVariableNumber2(runtimeScene: RuntimeScene, identifier: string, variable: Variable, toValue: number, duration: number, easing: string): void
    • tweenVariableNumber3(runtimeScene: RuntimeScene, identifier: string, variable: Variable, toValue: number, easing: string, duration: number): void
    • tweenVariableNumber2(runtimeScene: RuntimeScene, identifier: string, variable: Variable, toValue: number, duration: number, easing: string): void
    • tweenVariableNumber3(runtimeScene: RuntimeScene, identifier: string, variable: Variable, toValue: number, easing: string, duration: number): void

    Variables

    easingFunctions: Record<string, EasingFunction> = ...

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    A namespace of functional equivalents to the gdjs.Variable methods, needed for events code generation.

    -
    namespace

    Index

    Functions

    • getFirstVariableNumber(array: Variable): number

    Index

    Functions

    • getFirstVariableNumber(array: Variable): number
    • getFirstVariableString(array: Variable): string
    • getFirstVariableString(array: Variable): string
    • getLastVariableNumber(array: Variable): number
    • getLastVariableNumber(array: Variable): number
    • getLastVariableString(array: Variable): string
    • getLastVariableString(array: Variable): string
    • getVariableBoolean(variable: Variable, compareWith: boolean): boolean
    • getVariableBoolean(variable: Variable, compareWith: boolean): boolean
    • Compares the boolean value of a variable. Equivalent to variable.getAsBoolean() === boolean. This shortcut function is needed for events code generation.

      -

      Parameters

      Returns boolean

    • getVariableChildCount(variable: Variable): number
    • getVariableChildCount(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableNumber(variable: Variable): number
    • getVariableString(variable: Variable): string
    • getVariableString(variable: Variable): string
    • sceneVariableExists(runtimeScene: RuntimeScene, variableName: string): boolean
    • sceneVariableExists(runtimeScene: RuntimeScene, variableName: string): boolean
    • setVariableBoolean(variable: Variable, newValue: boolean): void
    • setVariableBoolean(variable: Variable, newValue: boolean): void
    • toggleVariableBoolean(variable: Variable): void
    • toggleVariableBoolean(variable: Variable): void
    • valuePush(array: Variable, value: string | number | boolean): void
    • valuePush(array: Variable, value: string | number | boolean): void
    • variableChildExists(variable: Variable, childName: string): boolean
    • variableChildExists(variable: Variable, childName: string): boolean
    • variableClearChildren(variable: Variable): void
    • variableClearChildren(variable: Variable): void
    • variableRemoveAt(array: Variable, index: number): void
    • variableRemoveAt(array: Variable, index: number): void
    • variableRemoveChild(variable: Variable, childName: string): void
    • variableRemoveChild(variable: Variable, childName: string): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Tools related to window, for events generated code.

    -

    Index

    Functions

    • getWindowInnerHeight(): number
    • getWindowInnerWidth(): number
    • setAdaptGameResolutionAtRuntime(runtimeScene: RuntimeScene, enable: boolean): void
    • setFullScreen(runtimeScene: RuntimeScene, enable: boolean, keepAspectRatio: boolean): void
    • setGameResolutionResizeMode(runtimeScene: RuntimeScene, resizeMode: string): void
    • setGameResolutionSize(runtimeScene: RuntimeScene, width: number, height: number): void
    • setMargins(runtimeScene: RuntimeScene, top: number, right: number, bottom: number, left: number): void
    • setWindowSize(runtimeScene: RuntimeScene, width: number, height: number, updateGameResolution: boolean): void
    • setWindowTitle(runtimeScene: RuntimeScene, title: string): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    • deleteFile(filePath: string, resultVar: Variable): void
    • deleteFileAsync(filePath: string, resultVar: Variable): void

    Returns void

    • getDirectoryName(fileOrFolderPath: string): string
    • getDirectoryName(fileOrFolderPath: string): string
    • getExtensionName(filePath: string): string
    • getFileName(filePath: string): string
    • getPathDelimiter(): string
    • getExtensionName(filePath: string): string
    • getFileName(filePath: string): string
    • getPathDelimiter(): string
    • loadStringFromFile(stringVar: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void
    • loadStringFromFile(stringVar: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void
    • Load a string from a file into a scene variable.

      Parameters

      • stringVar: Variable

        Variable where to store the content

        @@ -61,7 +61,7 @@

        The variable where to store the result of the operation

      • removeCRCharacters: boolean

        If true, will remove \r characters usually added by Windows when editing files

        -

      Returns void

    • loadStringFromFileAsync(stringVar: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void

    Returns void

    • loadStringFromFileAsync(stringVar: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void
    • Load a string from a file into a scene variable, asynchronously.

      Parameters

      • stringVar: Variable

        Variable where to store the content

        @@ -71,7 +71,7 @@

        The variable where to store the result of the operation

      • removeCRCharacters: boolean

        If true, will remove \r characters usually added by Windows when editing files

        -

      Returns void

    • loadVariableFromJSONFile(variable: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void

    Returns void

    • loadVariableFromJSONFile(variable: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void
    • Load a JSON file and convert it into a variable.

      Parameters

      • variable: Variable

        Variable to store the variable

        @@ -81,7 +81,7 @@

        The variable where to store the result of the operation

      • removeCRCharacters: boolean

        If true, will remove \r characters usually added by Windows when editing files

        -

      Returns void

    • loadVariableFromJSONFileAsync(variable: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void

    Returns void

    • loadVariableFromJSONFileAsync(variable: Variable, loadPath: string, resultVar: Variable, removeCRCharacters: boolean): void
    • Load a JSON file and convert it into a variable, asynchronously.

      Parameters

      • variable: Variable

        Variable to store the variable

        @@ -91,18 +91,18 @@

        The variable where to store the result of the operation

      • removeCRCharacters: boolean

        If true, will remove \r characters usually added by Windows when editing files

        -

      Returns void

    • makeDirectory(directory: string, resultVar: Variable): void

    Returns void

    • makeDirectory(directory: string, resultVar: Variable): void
    • pathExists(filePath: string): boolean

    Returns void

    • pathExists(filePath: string): boolean
    • saveStringToFile(text: string, savePath: string, resultVar: Variable): void
    • saveStringToFile(text: string, savePath: string, resultVar: Variable): void
    • saveStringToFileAsync(text: string, savePath: string, resultVar: Variable): void

    Returns void

    • saveStringToFileAsync(text: string, savePath: string, resultVar: Variable): void
    • Save a string into a file, asynchronously.

      Parameters

      • text: string

        The string to be saved

        @@ -118,7 +118,7 @@

        Path to the file

      • resultVar: Variable

        The variable where to store the result of the operation

        -

      Returns void

    • saveVariableToJSONFile(variable: Variable, savePath: string, resultVar: Variable): void

    Returns void

    • saveVariableToJSONFile(variable: Variable, savePath: string, resultVar: Variable): void
    • saveVariableToJSONFileAsync(variable: Variable, savePath: string, resultVar: Variable): void

    Returns void

    • saveVariableToJSONFileAsync(variable: Variable, savePath: string, resultVar: Variable): void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Type aliases

    Classes

    Interfaces

    Variables

    Namespaces

    Enumerations

    Functions

    Type aliases

    AABB: { max: FloatPoint; min: FloatPoint }
    +gdjs | GDevelop JavaScript game engine
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Type aliases

    Classes

    Interfaces

    Variables

    Namespaces

    Enumerations

    Functions

    Type aliases

    AABB: { max: FloatPoint; min: FloatPoint }

    An axis-aligned bounding box. Used to represents a box around an object for example.

    Type declaration

    • max: FloatPoint

      The [x,y] coordinates of the bottom right point

    • min: FloatPoint

      The [x,y] coordinates of the top left point

      -
    Antialiasing: "none" | "low" | "medium" | "high"
    BBTextObjectData: ObjectData & BBTextObjectDataType
    BBTextObjectDataType: { content: { align: "left" | "center" | "right"; color: string; fontFamily: string; fontSize: number; opacity: number; text: string; visible: boolean; wordWrap: boolean } }
    +
    Antialiasing: "none" | "low" | "medium" | "high"
    BBTextObjectData: ObjectData & BBTextObjectDataType
    BBTextObjectDataType: { content: { align: "left" | "center" | "right"; color: string; fontFamily: string; fontSize: number; opacity: number; text: string; visible: boolean; wordWrap: boolean } }

    Base parameters for gdjs.BBTextRuntimeObject

    Type declaration

    • content: { align: "left" | "center" | "right"; color: string; fontFamily: string; fontSize: number; opacity: number; text: string; visible: boolean; wordWrap: boolean }

      The base parameters of the BBText

      @@ -24,7 +24,7 @@

      Deprecated - Is the text visible?

    • wordWrap: boolean

      Activate word wrap if set to true

      -
    BBTextObjectNetworkSyncData: ObjectNetworkSyncData & BBTextObjectNetworkSyncDataType
    BBTextObjectNetworkSyncDataType: { align: string; c: number[]; ff: string; fs: number; hidden: boolean; o: float; text: string; wwidth: float; wwrap: boolean }

    Type declaration

    • align: string
    • c: number[]
    • ff: string
    • fs: number
    • hidden: boolean
    • o: float
    • text: string
    • wwidth: float
    • wwrap: boolean
    BBTextRuntimeObjectRenderer: BBTextRuntimeObjectPixiRenderer
    BitmapFontManager: PixiBitmapFontManager
    BitmapTextObjectData: ObjectData & BitmapTextObjectDataType
    BitmapTextObjectDataType: { content: { align: "left" | "center" | "right"; bitmapFontResourceName: string; opacity: float; scale: float; text: string; textureAtlasResourceName: string; tint: string; wordWrap: boolean; wrappingWidth: float } }
    +
    BBTextObjectNetworkSyncData: ObjectNetworkSyncData & BBTextObjectNetworkSyncDataType
    BBTextObjectNetworkSyncDataType: { align: string; c: number[]; ff: string; fs: number; hidden: boolean; o: float; text: string; wwidth: float; wwrap: boolean }

    Type declaration

    • align: string
    • c: number[]
    • ff: string
    • fs: number
    • hidden: boolean
    • o: float
    • text: string
    • wwidth: float
    • wwrap: boolean
    BBTextRuntimeObjectRenderer: BBTextRuntimeObjectPixiRenderer
    BitmapFontManager: PixiBitmapFontManager
    BitmapTextObjectData: ObjectData & BitmapTextObjectDataType
    BitmapTextObjectDataType: { content: { align: "left" | "center" | "right"; bitmapFontResourceName: string; opacity: float; scale: float; text: string; textureAtlasResourceName: string; tint: string; wordWrap: boolean; wrappingWidth: float } }

    Base parameters for gdjs.BitmapTextRuntimeObject

    Type declaration

    • content: { align: "left" | "center" | "right"; bitmapFontResourceName: string; opacity: float; scale: float; text: string; textureAtlasResourceName: string; tint: string; wordWrap: boolean; wrappingWidth: float }

      The base parameters of the Bitmap Text

      @@ -46,9 +46,9 @@

      Activate word wrap if set to true.

    • wrappingWidth: float

      Wrapping with from custom size properties.

      -
    BitmapTextObjectNetworkSyncData: ObjectNetworkSyncData & BitmapTextObjectNetworkSyncDataType
    BitmapTextObjectNetworkSyncDataType: { align: string; bfrn: string; opa: float; scale: number; tarn: string; text: string; tint: number[]; wwidth: float; wwrap: boolean }

    Type declaration

    • align: string
    • bfrn: string
    • opa: float
    • scale: number
    • tarn: string
    • text: string
    • tint: number[]
    • wwidth: float
    • wwrap: boolean
    ChangedRuntimeBehavior: { behaviorTypeName: string; newBehaviorConstructor: Function; oldBehaviorConstructor: Function }

    Type declaration

    • behaviorTypeName: string
    • newBehaviorConstructor: Function
    • oldBehaviorConstructor: Function
    CollisionTestResult: { collision: boolean; move_axis: FloatPoint }

    Type declaration

    • collision: boolean
    • move_axis: FloatPoint
    Cube3DRuntimeObjectRenderer: Cube3DRuntimeObjectPixiRenderer
    CustomObjectConfiguration: ObjectConfiguration & { animatable?: SpriteAnimationData[]; childrenContent: {} }
    CustomRuntimeObject2DRenderer: CustomRuntimeObject2DPixiRenderer
    DebuggerRenderer: DebuggerPixiRenderer
    DummyRuntimeObjectRenderer: DummyRuntimeObjectPixiRenderer
    EffectsManager: PixiEffectsManager
    FrameMeasure: { lastStartTime: float; parent: FrameMeasure | null; subsections: Record<string, FrameMeasure>; time: float }

    Type declaration

    HotReloaderLog: { kind: "fatal" | "error" | "warning" | "info"; message: string }

    Type declaration

    • kind: "fatal" | "error" | "warning" | "info"
    • message: string
    ImageManager: PixiImageManager
    JsonManagerRequestCallback: (error: Error | null, content: Object | null) => void

    Type declaration

      • (error: Error | null, content: Object | null): void
      • +
    BitmapTextObjectNetworkSyncData: ObjectNetworkSyncData & BitmapTextObjectNetworkSyncDataType
    BitmapTextObjectNetworkSyncDataType: { align: string; bfrn: string; opa: float; scale: number; tarn: string; text: string; tint: number[]; wwidth: float; wwrap: boolean }

    Type declaration

    • align: string
    • bfrn: string
    • opa: float
    • scale: number
    • tarn: string
    • text: string
    • tint: number[]
    • wwidth: float
    • wwrap: boolean
    ChangedRuntimeBehavior: { behaviorTypeName: string; newBehaviorConstructor: Function; oldBehaviorConstructor: Function }

    Type declaration

    • behaviorTypeName: string
    • newBehaviorConstructor: Function
    • oldBehaviorConstructor: Function
    CollisionTestResult: { collision: boolean; move_axis: FloatPoint }

    Type declaration

    • collision: boolean
    • move_axis: FloatPoint
    Cube3DRuntimeObjectRenderer: Cube3DRuntimeObjectPixiRenderer
    CustomObjectConfiguration: ObjectConfiguration & { animatable?: SpriteAnimationData[]; childrenContent: {} }
    CustomRuntimeObject2DRenderer: CustomRuntimeObject2DPixiRenderer
    DebuggerRenderer: DebuggerPixiRenderer
    DummyRuntimeObjectRenderer: DummyRuntimeObjectPixiRenderer
    EffectsManager: PixiEffectsManager
    FrameMeasure: { lastStartTime: float; parent: FrameMeasure | null; subsections: Record<string, FrameMeasure>; time: float }

    Type declaration

    HotReloaderLog: { kind: "fatal" | "error" | "warning" | "info"; message: string }

    Type declaration

    • kind: "fatal" | "error" | "warning" | "info"
    • message: string
    ImageManager: PixiImageManager
    JsonManagerRequestCallback: (error: Error | null, content: Object | null) => void

    Type declaration

      • (error: Error | null, content: Object | null): void
      • The callback called when a json that was requested is loaded (or an error occurred).

        -

        Parameters

        • error: Error | null
        • content: Object | null

        Returns void

    LayerRenderer: LayerPixiRenderer
    LightNetworkSyncData: ObjectNetworkSyncData & LightNetworkSyncDataType
    LightNetworkSyncDataType: { col: string; rad: number }

    Type declaration

    • col: string
    • rad: number
    LightObjectData: ObjectData & LightObjectDataType
    LightObjectDataType: { content: { color: string; debugMode: boolean; radius: number; texture: string } }

    Type declaration

    • content: { color: string; debugMode: boolean; radius: number; texture: string }
      +

      Parameters

      • error: Error | null
      • content: Object | null

      Returns void

    LayerRenderer: LayerPixiRenderer
    LightNetworkSyncData: ObjectNetworkSyncData & LightNetworkSyncDataType
    LightNetworkSyncDataType: { col: string; rad: number }

    Type declaration

    • col: string
    • rad: number
    LightObjectData: ObjectData & LightObjectDataType
    LightObjectDataType: { content: { color: string; debugMode: boolean; radius: number; texture: string } }

    Type declaration

    • content: { color: string; debugMode: boolean; radius: number; texture: string }

      The base parameters of light object.

      • color: string

        A string representing color in hexadecimal format.

        @@ -58,7 +58,7 @@

        The radius of light object.

      • texture: string

        A string representing the name of texture used for light object.

        -
    LightRuntimeObjectRenderer: LightRuntimeObjectPixiRenderer
    Model3DRuntimeObjectRenderer: Model3DRuntimeObject3DRenderer
    MultiplayerMessageManager: ReturnType<typeof makeMultiplayerMessageManager>
    MultiplayerVariablesManager: ReturnType<typeof makeMultiplayerVariablesManager>
    Object3DNetworkSyncData: ObjectNetworkSyncData & Object3DNetworkSyncDataType
    ObjectConfiguration: { content: any }

    Type declaration

    • content: any
    PanelSpriteNetworkSyncData: ObjectNetworkSyncData & PanelSpriteNetworkSyncDataType
    PanelSpriteNetworkSyncDataType: { color: string; hei: number; op: number; wid: number }

    Type declaration

    • color: string
    • hei: number
    • op: number
    • wid: number
    PanelSpriteObjectData: ObjectData & PanelSpriteObjectDataType
    PanelSpriteObjectDataType: { bottomMargin: number; height: number; leftMargin: number; rightMargin: number; texture: string; tiled: boolean; topMargin: number; width: number }

    Type declaration

    • bottomMargin: number
      +
    LightRuntimeObjectRenderer: LightRuntimeObjectPixiRenderer
    Model3DRuntimeObjectRenderer: Model3DRuntimeObject3DRenderer
    MultiplayerMessageManager: ReturnType<typeof makeMultiplayerMessageManager>
    MultiplayerVariablesManager: ReturnType<typeof makeMultiplayerVariablesManager>
    Object3DNetworkSyncData: ObjectNetworkSyncData & Object3DNetworkSyncDataType
    ObjectConfiguration: { content: any }

    Type declaration

    • content: any
    PanelSpriteNetworkSyncData: ObjectNetworkSyncData & PanelSpriteNetworkSyncDataType
    PanelSpriteNetworkSyncDataType: { color: string; hei: number; op: number; wid: number }

    Type declaration

    • color: string
    • hei: number
    • op: number
    • wid: number
    PanelSpriteObjectData: ObjectData & PanelSpriteObjectDataType
    PanelSpriteObjectDataType: { bottomMargin: number; height: number; leftMargin: number; rightMargin: number; texture: string; tiled: boolean; topMargin: number; width: number }

    Type declaration

    • bottomMargin: number

      The bottom margin

    • height: number

      The object height

      @@ -74,7 +74,7 @@

      The top margin

    • width: number

      The object width

      -
    PanelSpriteRuntimeObjectRenderer: PanelSpriteRuntimeObjectPixiRenderer
    ParticleEmitterObjectData: ObjectData & ParticleEmitterObjectDataType
    ParticleEmitterObjectDataType: { additive: boolean; destroyWhenNoParticles: boolean; emitterAngleA: number; emitterAngleB: number; emitterForceMax: number; emitterForceMin: number; flow: number; jumpForwardInTimeOnCreation: number; maxParticleNb: number; particleAlpha1: number; particleAlpha2: number; particleAngle1: number; particleAngle2: number; particleBlue1: number; particleBlue2: number; particleGravityX: number; particleGravityY: number; particleGreen1: number; particleGreen2: number; particleLifeTimeMax: number; particleLifeTimeMin: number; particleRed1: number; particleRed2: number; particleSize1: number; particleSize2: number; particleSizeRandomness1: number; particleSizeRandomness2: number; rendererParam1: number; rendererParam2: number; rendererType: string; tank: number; textureParticleName: string; zoneRadius: number }

    Type declaration

    • additive: boolean
    • destroyWhenNoParticles: boolean
      +
    PanelSpriteRuntimeObjectRenderer: PanelSpriteRuntimeObjectPixiRenderer
    ParticleEmitterObjectData: ObjectData & ParticleEmitterObjectDataType
    ParticleEmitterObjectDataType: { additive: boolean; destroyWhenNoParticles: boolean; emitterAngleA: number; emitterAngleB: number; emitterForceMax: number; emitterForceMin: number; flow: number; jumpForwardInTimeOnCreation: number; maxParticleNb: number; particleAlpha1: number; particleAlpha2: number; particleAngle1: number; particleAngle2: number; particleBlue1: number; particleBlue2: number; particleGravityX: number; particleGravityY: number; particleGreen1: number; particleGreen2: number; particleLifeTimeMax: number; particleLifeTimeMin: number; particleRed1: number; particleRed2: number; particleSize1: number; particleSize2: number; particleSizeRandomness1: number; particleSizeRandomness2: number; rendererParam1: number; rendererParam2: number; rendererType: string; tank: number; textureParticleName: string; zoneRadius: number }

    Type declaration

    • additive: boolean
    • destroyWhenNoParticles: boolean

      Destroy the object when there is no particles?

    • emitterAngleA: number
      deprecated

      Data not used

    • emitterAngleB: number
      @@ -85,7 +85,7 @@

      Particle max rotation speed (degrees/second)

    • particleBlue1: number
    • particleBlue2: number
    • particleGravityX: number
    • particleGravityY: number
    • particleGreen1: number
    • particleGreen2: number
    • particleLifeTimeMax: number
    • particleLifeTimeMin: number
    • particleRed1: number
    • particleRed2: number
    • particleSize1: number
    • particleSize2: number
    • particleSizeRandomness1: number
    • particleSizeRandomness2: number
    • rendererParam1: number
    • rendererParam2: number
    • rendererType: string
    • tank: number
    • textureParticleName: string

      Resource name for image in particle

      -
    • zoneRadius: number
    ParticleEmitterObjectNetworkSyncData: ObjectNetworkSyncData & ParticleEmitterObjectNetworkSyncDataType
    ParticleEmitterObjectNetworkSyncDataType: { addr: boolean; alp1: number; alp2: number; angb: number; colb1: number; colb2: number; colg1: number; colg2: number; colr1: number; colr2: number; flow: number; formax: number; formin: number; gravx: number; gravy: number; ltmax: number; ltmin: number; mpc: number; paused: boolean; prms: number; prmx: number; size1: number; size2: number; tank: number; text: string; zr: number }

    Type declaration

    • addr: boolean
    • alp1: number
    • alp2: number
    • angb: number
    • colb1: number
    • colb2: number
    • colg1: number
    • colg2: number
    • colr1: number
    • colr2: number
    • flow: number
    • formax: number
    • formin: number
    • gravx: number
    • gravy: number
    • ltmax: number
    • ltmin: number
    • mpc: number
    • paused: boolean
    • prms: number
    • prmx: number
    • size1: number
    • size2: number
    • tank: number
    • text: string
    • zr: number
    ParticleEmitterObjectRenderer: ParticleEmitterObjectPixiRenderer
    ProfilerStats: { framesCount: integer }

    Type declaration

    • framesCount: integer
    RGBColor: { b: integer; g: integer; r: integer }
    +
  • zoneRadius: number
  • ParticleEmitterObjectNetworkSyncData: ObjectNetworkSyncData & ParticleEmitterObjectNetworkSyncDataType
    ParticleEmitterObjectNetworkSyncDataType: { addr: boolean; alp1: number; alp2: number; angb: number; colb1: number; colb2: number; colg1: number; colg2: number; colr1: number; colr2: number; flow: number; formax: number; formin: number; gravx: number; gravy: number; ltmax: number; ltmin: number; mpc: number; paused: boolean; prms: number; prmx: number; size1: number; size2: number; tank: number; text: string; zr: number }

    Type declaration

    • addr: boolean
    • alp1: number
    • alp2: number
    • angb: number
    • colb1: number
    • colb2: number
    • colg1: number
    • colg2: number
    • colr1: number
    • colr2: number
    • flow: number
    • formax: number
    • formin: number
    • gravx: number
    • gravy: number
    • ltmax: number
    • ltmin: number
    • mpc: number
    • paused: boolean
    • prms: number
    • prmx: number
    • size1: number
    • size2: number
    • tank: number
    • text: string
    • zr: number
    ParticleEmitterObjectRenderer: ParticleEmitterObjectPixiRenderer
    ProfilerStats: { framesCount: integer }

    Type declaration

    • framesCount: integer
    RGBColor: { b: integer; g: integer; r: integer }

    Represents a color in RGB Format

    Type declaration

    • b: integer

      The Blue component of the color, from 0 to 255.

      @@ -93,7 +93,7 @@

      The Green component of the color, from 0 to 255.

    • r: integer

      The Red component of the color, from 0 to 255.

      -
    RaycastTestResult: { closeSqDist: float; closeX: float; closeY: float; collision: boolean; farSqDist: float; farX: float; farY: float }

    Type declaration

    • closeSqDist: float
    • closeX: float
    • closeY: float
    • collision: boolean
    • farSqDist: float
    • farX: float
    • farY: float
    RendererObjectInterface: { visible: boolean }

    Type declaration

    • visible: boolean
    RuntimeGameOptions: { allowAuthenticationUsingIframeForPreview?: boolean; electronRemoteRequirePath?: string; environment?: "dev"; forceFullscreen?: boolean; gdevelopResourceToken?: string; injectExternalLayout?: string; isPreview?: boolean; nativeMobileApp?: boolean; playerId?: string; playerToken?: string; playerUsername?: string; projectDataOnlyExport?: boolean; scriptFiles?: RuntimeGameOptionsScriptFile[]; websocketDebuggerServerAddress?: string; websocketDebuggerServerPort?: string }
    +
    RaycastTestResult: { closeSqDist: float; closeX: float; closeY: float; collision: boolean; farSqDist: float; farX: float; farY: float }

    Type declaration

    • closeSqDist: float
    • closeX: float
    • closeY: float
    • collision: boolean
    • farSqDist: float
    • farX: float
    • farY: float
    RendererObjectInterface: { visible: boolean }

    Type declaration

    • visible: boolean
    RuntimeGameOptions: { allowAuthenticationUsingIframeForPreview?: boolean; electronRemoteRequirePath?: string; environment?: "dev"; forceFullscreen?: boolean; gdevelopResourceToken?: string; injectExternalLayout?: string; isPreview?: boolean; nativeMobileApp?: boolean; playerId?: string; playerToken?: string; playerUsername?: string; projectDataOnlyExport?: boolean; scriptFiles?: RuntimeGameOptionsScriptFile[]; websocketDebuggerServerAddress?: string; websocketDebuggerServerPort?: string }

    Options given to the game at startup.

    Type declaration

    • Optional allowAuthenticationUsingIframeForPreview?: boolean

      Check if, in some exceptional cases, we allow authentication @@ -133,13 +133,13 @@

      The address of the debugger server, to reach out using WebSocket.

    • Optional websocketDebuggerServerPort?: string

      The port of the debugger server, to reach out using WebSocket.

      -
    RuntimeGameOptionsScriptFile: { hash: number; path: string }
    +
    RuntimeGameOptionsScriptFile: { hash: number; path: string }

    Identify a script file, with its content hash (useful for hot-reloading).

    Type declaration

    • hash: number

      The hash of the script file content.

    • path: string

      The path for this script file.

      -
    RuntimeGameRenderer: RuntimeGamePixiRenderer
    RuntimeInstanceContainerRenderer: RuntimeInstanceContainerPixiRenderer
    RuntimeSceneRenderer: RuntimeScenePixiRenderer
    ShapePainterObjectData: ObjectData & ShapePainterObjectDataType
    ShapePainterObjectDataType: { absoluteCoordinates: boolean; antialiasing: Antialiasing; clearBetweenFrames: boolean; fillColor: RGBColor; fillOpacity: float; outlineColor: RGBColor; outlineOpacity: float; outlineSize: float }
    +
    RuntimeGameRenderer: RuntimeGamePixiRenderer
    RuntimeInstanceContainerRenderer: RuntimeInstanceContainerPixiRenderer
    RuntimeSceneRenderer: RuntimeScenePixiRenderer
    ShapePainterObjectData: ObjectData & ShapePainterObjectDataType
    ShapePainterObjectDataType: { absoluteCoordinates: boolean; antialiasing: Antialiasing; clearBetweenFrames: boolean; fillColor: RGBColor; fillOpacity: float; outlineColor: RGBColor; outlineOpacity: float; outlineSize: float }

    Initial properties for a for gdjs.ShapePainterRuntimeObject.

    Type declaration

    • absoluteCoordinates: boolean

      Use absolute coordinates?

      @@ -157,9 +157,9 @@

      The opacity of the outline of the painted shape, from 0 to 255

    • outlineSize: float

      The size of the outline of the painted shape, in pixels.

      -
    ShapePainterRuntimeObjectRenderer: ShapePainterRuntimeObjectPixiRenderer
    SoundManager: HowlerSoundManager
    SpineAtlasManagerRequestCallback: (error: Error | null, content?: pixi_spine.TextureAtlas) => void

    Type declaration

      • (error: Error | null, content?: pixi_spine.TextureAtlas): void
      • +
    ShapePainterRuntimeObjectRenderer: ShapePainterRuntimeObjectPixiRenderer
    SoundManager: HowlerSoundManager
    SpineAtlasManagerRequestCallback: (error: Error | null, content?: pixi_spine.TextureAtlas) => void

    Type declaration

      • (error: Error | null, content?: pixi_spine.TextureAtlas): void
      • The callback called when a text that was requested is loaded (or an error occurred).

        -

        Parameters

        • error: Error | null
        • Optional content: pixi_spine.TextureAtlas

        Returns void

    SpineNetworkSyncData: ObjectNetworkSyncData & SpineNetworkSyncDataType
    SpineNetworkSyncDataType: { anet: number; ani: number; anmd: number; anp: boolean; anss: float; flipX: boolean; flipY: boolean; hei: float; opa: float; scaX: float; scaY: float; wid: float }

    Type declaration

    • anet: number
    • ani: number
    • anmd: number
    • anp: boolean
    • anss: float
    • flipX: boolean
    • flipY: boolean
    • hei: float
    • opa: float
    • scaX: float
    • scaY: float
    • wid: float
    SpineObjectData: ObjectData & SpineObjectDataType
    SpineObjectDataType: { content: { animations: SpineAnimation[]; opacity: float; scale: float; spineResourceName: string; timeScale: float } }

    Type declaration

    • content: { animations: SpineAnimation[]; opacity: float; scale: float; spineResourceName: string; timeScale: float }
      • animations: SpineAnimation[]
      • opacity: float
      • scale: float
      • spineResourceName: string
      • timeScale: float
    SpriteAnimationData: { directions: SpriteDirectionData[]; name: string; useMultipleDirections: boolean }
    +

    Parameters

    Returns void

    SpineNetworkSyncData: ObjectNetworkSyncData & SpineNetworkSyncDataType
    SpineNetworkSyncDataType: { anet: number; ani: number; anmd: number; anp: boolean; anss: float; flipX: boolean; flipY: boolean; hei: float; opa: float; scaX: float; scaY: float; wid: float }

    Type declaration

    • anet: number
    • ani: number
    • anmd: number
    • anp: boolean
    • anss: float
    • flipX: boolean
    • flipY: boolean
    • hei: float
    • opa: float
    • scaX: float
    • scaY: float
    • wid: float
    SpineObjectData: ObjectData & SpineObjectDataType
    SpineObjectDataType: { content: { animations: SpineAnimation[]; opacity: float; scale: float; spineResourceName: string; timeScale: float } }

    Type declaration

    • content: { animations: SpineAnimation[]; opacity: float; scale: float; spineResourceName: string; timeScale: float }
      • animations: SpineAnimation[]
      • opacity: float
      • scale: float
      • spineResourceName: string
      • timeScale: float
    SpriteAnimationData: { directions: SpriteDirectionData[]; name: string; useMultipleDirections: boolean }

    Represents the data of a gdjs.SpriteAnimation.

    Type declaration

    SpriteAnimatorNetworkSyncData: { an: integer; di: integer; et: float; fr: integer; pa: boolean; ss: float }
    +
    SpriteAnimatorNetworkSyncData: { an: integer; di: integer; et: float; fr: integer; pa: boolean; ss: float }

    Represents all the information needed to synchronize the animations of an object.

    -

    Type declaration

    • an: integer
    • di: integer
    • et: float
    • fr: integer
    • pa: boolean
    • ss: float
    SpriteCenterPointData: { automatic: boolean; name: string; x: float; y: float }
    +

    Type declaration

    • an: integer
    • di: integer
    • et: float
    • fr: integer
    • pa: boolean
    • ss: float
    SpriteCenterPointData: { automatic: boolean; name: string; x: float; y: float }

    Represents the center point in a frame.

    Type declaration

    • automatic: boolean

      Is the center automatically computed?

      @@ -179,7 +179,7 @@

      X position of the point.

    • y: float

      Y position of the point.

      -
    SpriteCustomPointData: { name: string; x: float; y: float }
    +
    SpriteCustomPointData: { name: string; x: float; y: float }

    Represents a custom point in a frame.

    Type declaration

    • name: string

      Name of the point.

      @@ -187,7 +187,7 @@

      X position of the point.

    • y: float

      Y position of the point.

      -
    SpriteDirectionData: { looping: boolean; sprites: SpriteFrameData[]; timeBetweenFrames: float }
    +
    SpriteDirectionData: { looping: boolean; sprites: SpriteFrameData[]; timeBetweenFrames: float }

    Represents the data of a gdjs.SpriteAnimationDirection.

    Type declaration

    • looping: boolean

      Is the animation looping?

      @@ -195,7 +195,7 @@

      The list of frames.

    • timeBetweenFrames: float

      Time between each frame, in seconds.

      -
    SpriteFrameData: { centerPoint: SpriteCenterPointData; customCollisionMask: SpritePoint[][]; hasCustomCollisionMask: boolean; image: string; originPoint: SpriteCustomPointData; points: SpriteCustomPointData[] }
    +
    SpriteFrameData: { centerPoint: SpriteCenterPointData; customCollisionMask: SpritePoint[][]; hasCustomCollisionMask: boolean; image: string; originPoint: SpriteCustomPointData; points: SpriteCustomPointData[] }

    Type declaration

    SpriteNetworkSyncData: ObjectNetworkSyncData & SpriteNetworkSyncDataType
    SpriteNetworkSyncDataType: { anim: SpriteAnimatorNetworkSyncData; color: string; ifx: boolean; ify: boolean; op: float; sx: float; sy: float }

    Type declaration

    SpriteObjectData: ObjectData & SpriteObjectDataType
    SpriteObjectDataType: { animations: SpriteAnimationData[]; updateIfNotVisible: boolean }
    +
    SpriteNetworkSyncData: ObjectNetworkSyncData & SpriteNetworkSyncDataType
    SpriteNetworkSyncDataType: { anim: SpriteAnimatorNetworkSyncData; color: string; ifx: boolean; ify: boolean; op: float; sx: float; sy: float }

    Type declaration

    SpriteObjectData: ObjectData & SpriteObjectDataType
    SpriteObjectDataType: { animations: SpriteAnimationData[]; updateIfNotVisible: boolean }

    Represents the data of a gdjs.SpriteRuntimeObject.

    Type declaration

    SpritePoint: { x: float; y: float }
    +
    SpritePoint: { x: float; y: float }

    Represents a point in a coordinate system.

    Type declaration

    • x: float

      X position of the point.

    • y: float

      Y position of the point.

      -
    SpriteRuntimeObjectRenderer: SpriteRuntimeObjectPixiRenderer
    TextEntryRuntimeObjectRenderer: TextEntryRuntimeObjectPixiRenderer
    TextInputNetworkSyncData: ObjectNetworkSyncData & TextInputNetworkSyncDataType
    TextInputNetworkSyncDataType: { bc: string; bo: float; bw: float; dis: boolean; fc: string; fo: float; frn: string; fs: number; hei: float; it: SupportedInputType; opa: float; place: string; ro: boolean; tc: string; txt: string; wid: float }

    Type declaration

    • bc: string
    • bo: float
    • bw: float
    • dis: boolean
    • fc: string
    • fo: float
    • frn: string
    • fs: number
    • hei: float
    • it: SupportedInputType
    • opa: float
    • place: string
    • ro: boolean
    • tc: string
    • txt: string
    • wid: float
    TextInputRuntimeObjectRenderer: TextInputRuntimeObjectPixiRenderer
    TextObjectData: ObjectData & TextObjectDataType
    TextObjectDataType: { content: { bold: boolean; characterSize: number; color: string; font: string; isOutlineEnabled: boolean; isShadowEnabled: boolean; italic: boolean; outlineColor: string; outlineThickness: float; shadowAngle: float; shadowBlurRadius: float; shadowColor: string; shadowDistance: float; shadowOpacity: float; text: string; textAlignment: string; underlined: boolean } }
    +
    SpriteRuntimeObjectRenderer: SpriteRuntimeObjectPixiRenderer
    TextEntryRuntimeObjectRenderer: TextEntryRuntimeObjectPixiRenderer
    TextInputNetworkSyncData: ObjectNetworkSyncData & TextInputNetworkSyncDataType
    TextInputNetworkSyncDataType: { bc: string; bo: float; bw: float; dis: boolean; fc: string; fo: float; frn: string; fs: number; hei: float; it: SupportedInputType; opa: float; place: string; ro: boolean; tc: string; txt: string; wid: float }

    Type declaration

    • bc: string
    • bo: float
    • bw: float
    • dis: boolean
    • fc: string
    • fo: float
    • frn: string
    • fs: number
    • hei: float
    • it: SupportedInputType
    • opa: float
    • place: string
    • ro: boolean
    • tc: string
    • txt: string
    • wid: float
    TextInputRuntimeObjectRenderer: TextInputRuntimeObjectPixiRenderer
    TextObjectData: ObjectData & TextObjectDataType
    TextObjectDataType: { content: { bold: boolean; characterSize: number; color: string; font: string; isOutlineEnabled: boolean; isShadowEnabled: boolean; italic: boolean; outlineColor: string; outlineThickness: float; shadowAngle: float; shadowBlurRadius: float; shadowColor: string; shadowDistance: float; shadowOpacity: float; text: string; textAlignment: string; underlined: boolean } }

    Base parameters for gdjs.TextRuntimeObject

    Type declaration

    • content: { bold: boolean; characterSize: number; color: string; font: string; isOutlineEnabled: boolean; isShadowEnabled: boolean; italic: boolean; outlineColor: string; outlineThickness: float; shadowAngle: float; shadowBlurRadius: float; shadowColor: string; shadowDistance: float; shadowOpacity: float; text: string; textAlignment: string; underlined: boolean }
      • bold: boolean

        Is Bold?

        @@ -241,13 +241,13 @@

        The text of the object

      • textAlignment: string
      • underlined: boolean

        Is Underlined?

        -
    TextObjectNetworkSyncData: ObjectNetworkSyncData & TextObjectNetworkSyncDataType
    TextObjectNetworkSyncDataType: { b: boolean; c: number[]; cs: number; fn: string; i: boolean; o: float; oc: number[]; oena: boolean; ot: float; pad: integer; scale: number; sh: boolean; sha: float; shb: float; shc: number[]; shd: float; sho: float; str: string; ta: string; u: boolean; wrap: boolean; wrapw: float }

    Type declaration

    • b: boolean
    • c: number[]
    • cs: number
    • fn: string
    • i: boolean
    • o: float
    • oc: number[]
    • oena: boolean
    • ot: float
    • pad: integer
    • scale: number
    • sh: boolean
    • sha: float
    • shb: float
    • shc: number[]
    • shd: float
    • sho: float
    • str: string
    • ta: string
    • u: boolean
    • wrap: boolean
    • wrapw: float
    TextRuntimeObjectRenderer: TextRuntimeObjectPixiRenderer
    TileMapRuntimeObjectRenderer: TileMapRuntimeObjectPixiRenderer
    TiledSpriteNetworkSyncData: ObjectNetworkSyncData & TiledSpriteNetworkSyncDataType
    TiledSpriteNetworkSyncDataType: { color: string; hei: number; op: number; wid: number; xo: number; yo: number }

    Type declaration

    • color: string
    • hei: number
    • op: number
    • wid: number
    • xo: number
    • yo: number
    TiledSpriteObjectData: ObjectData & TiledSpriteObjectDataType
    TiledSpriteObjectDataType: { height: number; texture: string; width: number }
    +
    TextObjectNetworkSyncData: ObjectNetworkSyncData & TextObjectNetworkSyncDataType
    TextObjectNetworkSyncDataType: { b: boolean; c: number[]; cs: number; fn: string; i: boolean; o: float; oc: number[]; oena: boolean; ot: float; pad: integer; scale: number; sh: boolean; sha: float; shb: float; shc: number[]; shd: float; sho: float; str: string; ta: string; u: boolean; wrap: boolean; wrapw: float }

    Type declaration

    • b: boolean
    • c: number[]
    • cs: number
    • fn: string
    • i: boolean
    • o: float
    • oc: number[]
    • oena: boolean
    • ot: float
    • pad: integer
    • scale: number
    • sh: boolean
    • sha: float
    • shb: float
    • shc: number[]
    • shd: float
    • sho: float
    • str: string
    • ta: string
    • u: boolean
    • wrap: boolean
    • wrapw: float
    TextRuntimeObjectRenderer: TextRuntimeObjectPixiRenderer
    TileMapRuntimeObjectRenderer: TileMapRuntimeObjectPixiRenderer
    TiledSpriteNetworkSyncData: ObjectNetworkSyncData & TiledSpriteNetworkSyncDataType
    TiledSpriteNetworkSyncDataType: { color: string; hei: number; op: number; wid: number; xo: number; yo: number }

    Type declaration

    • color: string
    • hei: number
    • op: number
    • wid: number
    • xo: number
    • yo: number
    TiledSpriteObjectData: ObjectData & TiledSpriteObjectDataType
    TiledSpriteObjectDataType: { height: number; texture: string; width: number }

    Initial properties for a Tiled Sprite object

    Type declaration

    • height: number

      Default height of the object, if the instance has no custom height.

    • texture: string
    • width: number

      Default width of the object, if the instance has no custom width.

      -
    TiledSpriteRuntimeObjectRenderer: TiledSpriteRuntimeObjectPixiRenderer
    TilemapCollisionMaskNetworkSyncData: ObjectNetworkSyncData & TilemapCollisionMaskNetworkSyncDataType
    TilemapCollisionMaskNetworkSyncDataType: { dm: boolean; fc: integer; fo: float; hei: float; oc: integer; oo: float; os: float; tmjf: string; tsjf: string; wid: float }

    Type declaration

    • dm: boolean
    • fc: integer
    • fo: float
    • hei: float
    • oc: integer
    • oo: float
    • os: float
    • tmjf: string
    • tsjf: string
    • wid: float
    TilemapCollisionMaskObjectData: ObjectData & TilemapCollisionMaskObjectDataType
    TilemapCollisionMaskObjectDataType: { content: { collisionMaskTag: string; debugMode: boolean; fillColor: string; outlineColor: string; tilemapJsonFile: string; tilesetJsonFile: string }; fillOpacity: float; outlineOpacity: float; outlineSize: float }

    Type declaration

    • content: { collisionMaskTag: string; debugMode: boolean; fillColor: string; outlineColor: string; tilemapJsonFile: string; tilesetJsonFile: string }
      • collisionMaskTag: string
      • debugMode: boolean
      • fillColor: string
      • outlineColor: string
      • tilemapJsonFile: string
      • tilesetJsonFile: string
    • fillOpacity: float
    • outlineOpacity: float
    • outlineSize: float
    TilemapNetworkSyncData: ObjectNetworkSyncData & TilemapNetworkSyncDataType
    TilemapNetworkSyncDataType: { asps: number; dm: string; hei: number; lai: number; lei: number; op: number; tmai: string; tmjf: string; tsjf: string; wid: number }

    Type declaration

    • asps: number
    • dm: string
    • hei: number
    • lai: number
    • lei: number
    • op: number
    • tmai: string
    • tmjf: string
    • tsjf: string
    • wid: number
    TilemapObjectData: ObjectData & TilemapObjectDataType
    TilemapObjectDataType: { content: { animationFps: number; animationSpeedScale: number; displayMode: string; layerIndex: integer; levelIndex: integer; opacity: number; tilemapAtlasImage: string; tilemapJsonFile: string; tilesetJsonFile: string } }

    Type declaration

    • content: { animationFps: number; animationSpeedScale: number; displayMode: string; layerIndex: integer; levelIndex: integer; opacity: number; tilemapAtlasImage: string; tilemapJsonFile: string; tilesetJsonFile: string }
      • animationFps: number
      • animationSpeedScale: number
      • displayMode: string
      • layerIndex: integer
      • levelIndex: integer
      • opacity: number
      • tilemapAtlasImage: string
      • tilemapJsonFile: string
      • tilesetJsonFile: string
    VideoNetworkSyncData: ObjectNetworkSyncData & VideoNetworkSyncDataType
    VideoNetworkSyncDataType: { ct: float; hei: float; loop: boolean; op: float; pla: boolean; ps: number; wid: float }

    Type declaration

    • ct: float
    • hei: float
    • loop: boolean
    • op: float
    • pla: boolean
    • ps: number
    • wid: float
    VideoObjectData: ObjectData & VideoObjectDataType
    VideoObjectDataType: { content: { loop: boolean; opacity: number; videoResource: string; volume: number } }
    +
    TiledSpriteRuntimeObjectRenderer: TiledSpriteRuntimeObjectPixiRenderer
    TilemapCollisionMaskNetworkSyncData: ObjectNetworkSyncData & TilemapCollisionMaskNetworkSyncDataType
    TilemapCollisionMaskNetworkSyncDataType: { dm: boolean; fc: integer; fo: float; hei: float; oc: integer; oo: float; os: float; tmjf: string; tsjf: string; wid: float }

    Type declaration

    • dm: boolean
    • fc: integer
    • fo: float
    • hei: float
    • oc: integer
    • oo: float
    • os: float
    • tmjf: string
    • tsjf: string
    • wid: float
    TilemapCollisionMaskObjectData: ObjectData & TilemapCollisionMaskObjectDataType
    TilemapCollisionMaskObjectDataType: { content: { collisionMaskTag: string; debugMode: boolean; fillColor: string; outlineColor: string; tilemapJsonFile: string; tilesetJsonFile: string }; fillOpacity: float; outlineOpacity: float; outlineSize: float }

    Type declaration

    • content: { collisionMaskTag: string; debugMode: boolean; fillColor: string; outlineColor: string; tilemapJsonFile: string; tilesetJsonFile: string }
      • collisionMaskTag: string
      • debugMode: boolean
      • fillColor: string
      • outlineColor: string
      • tilemapJsonFile: string
      • tilesetJsonFile: string
    • fillOpacity: float
    • outlineOpacity: float
    • outlineSize: float
    TilemapNetworkSyncData: ObjectNetworkSyncData & TilemapNetworkSyncDataType
    TilemapNetworkSyncDataType: { asps: number; dm: string; hei: number; lai: number; lei: number; op: number; tmai: string; tmjf: string; tsjf: string; wid: number }

    Type declaration

    • asps: number
    • dm: string
    • hei: number
    • lai: number
    • lei: number
    • op: number
    • tmai: string
    • tmjf: string
    • tsjf: string
    • wid: number
    TilemapObjectData: ObjectData & TilemapObjectDataType
    TilemapObjectDataType: { content: { animationFps: number; animationSpeedScale: number; displayMode: string; layerIndex: integer; levelIndex: integer; opacity: number; tilemapAtlasImage: string; tilemapJsonFile: string; tilesetJsonFile: string } }

    Type declaration

    • content: { animationFps: number; animationSpeedScale: number; displayMode: string; layerIndex: integer; levelIndex: integer; opacity: number; tilemapAtlasImage: string; tilemapJsonFile: string; tilesetJsonFile: string }
      • animationFps: number
      • animationSpeedScale: number
      • displayMode: string
      • layerIndex: integer
      • levelIndex: integer
      • opacity: number
      • tilemapAtlasImage: string
      • tilemapJsonFile: string
      • tilesetJsonFile: string
    VideoNetworkSyncData: ObjectNetworkSyncData & VideoNetworkSyncDataType
    VideoNetworkSyncDataType: { ct: float; hei: float; loop: boolean; op: float; pla: boolean; ps: number; wid: float }

    Type declaration

    • ct: float
    • hei: float
    • loop: boolean
    • op: float
    • pla: boolean
    • ps: number
    • wid: float
    VideoObjectData: ObjectData & VideoObjectDataType
    VideoObjectDataType: { content: { loop: boolean; opacity: number; videoResource: string; volume: number } }

    The initial properties for gdjs.VideoRuntimeObject

    Type declaration

    • content: { loop: boolean; opacity: number; videoResource: string; volume: number }

      The base parameters of the video

      @@ -259,77 +259,77 @@

      Name of the resource corresponding to the video

    • volume: number

      The volume of the video

      -
    VideoRuntimeObjectRenderer: VideoRuntimeObjectPixiRenderer

    Variables

    BBTextRuntimeObjectRenderer: typeof BBTextRuntimeObjectPixiRenderer = BBTextRuntimeObjectPixiRenderer
    BitmapFontManager: typeof PixiBitmapFontManager = gdjs.PixiBitmapFontManager
    BitmapTextRuntimeObjectRenderer: typeof BitmapTextRuntimeObjectPixiRenderer = BitmapTextRuntimeObjectPixiRenderer
    Cube3DRuntimeObjectRenderer: typeof Cube3DRuntimeObjectPixiRenderer = Cube3DRuntimeObjectPixiRenderer
    CustomRuntimeObject2DRenderer: typeof CustomRuntimeObject2DPixiRenderer
    DebuggerClient: typeof WebsocketDebuggerClient = WebsocketDebuggerClient
    DebuggerRenderer: typeof DebuggerPixiRenderer
    DummyRuntimeObjectRenderer: typeof DummyRuntimeObjectPixiRenderer = DummyRuntimeObjectPixiRenderer
    EffectsManager: typeof PixiEffectsManager = PixiEffectsManager
    FontManager: typeof FontFaceObserverFontManager
    ImageManager: typeof PixiImageManager = gdjs.PixiImageManager
    LayerRenderer: typeof LayerPixiRenderer
    LightRuntimeObjectRenderer: typeof LightRuntimeObjectPixiRenderer = LightRuntimeObjectPixiRenderer
    LoadingScreenRenderer: typeof LoadingScreenPixiRenderer = LoadingScreenPixiRenderer
    Model3DRuntimeObjectRenderer: typeof Model3DRuntimeObject3DRenderer = Model3DRuntimeObject3DRenderer
    PanelSpriteRuntimeObjectRenderer: typeof PanelSpriteRuntimeObjectPixiRenderer = PanelSpriteRuntimeObjectPixiRenderer
    ParticleEmitterObjectRenderer: typeof ParticleEmitterObjectPixiRenderer = ParticleEmitterObjectPixiRenderer
    RuntimeGameRenderer: typeof RuntimeGamePixiRenderer
    RuntimeSceneRenderer: typeof RuntimeScenePixiRenderer
    ShapePainterRuntimeObjectRenderer: typeof ShapePainterRuntimeObjectPixiRenderer = ShapePainterRuntimeObjectPixiRenderer
    SoundManager: typeof HowlerSoundManager = HowlerSoundManager
    SpineRuntimeObjectRenderer: typeof SpineRuntimeObjectPixiRenderer = SpineRuntimeObjectPixiRenderer
    SpriteRuntimeObjectRenderer: typeof SpriteRuntimeObjectPixiRenderer = SpriteRuntimeObjectPixiRenderer
    TextEntryRuntimeObjectRenderer: typeof TextEntryRuntimeObjectPixiRenderer = TextEntryRuntimeObjectPixiRenderer
    TextInputRuntimeObjectRenderer: typeof TextInputRuntimeObjectPixiRenderer = TextInputRuntimeObjectPixiRenderer
    TextRuntimeObjectRenderer: typeof TextRuntimeObjectPixiRenderer = TextRuntimeObjectPixiRenderer
    TileMapRuntimeObjectRenderer: typeof TileMapRuntimeObjectPixiRenderer = gdjs.TileMapRuntimeObjectPixiRenderer
    TiledSpriteRuntimeObjectRenderer: typeof TiledSpriteRuntimeObjectPixiRenderer = TiledSpriteRuntimeObjectPixiRenderer
    VideoRuntimeObjectRenderer: typeof VideoRuntimeObjectPixiRenderer = VideoRuntimeObjectPixiRenderer
    behaviorsTypes: Hashtable<typeof RuntimeBehavior> = ...
    callbacksFirstRuntimeSceneLoaded: RuntimeSceneCallback[] = []
    callbacksObjectDeletedFromScene: RuntimeSceneRuntimeObjectCallback[] = []
    callbacksRuntimeSceneLoaded: RuntimeSceneCallback[] = []
    callbacksRuntimeScenePaused: RuntimeSceneCallback[] = []
    callbacksRuntimeScenePostEvents: RuntimeSceneCallback[] = []
    callbacksRuntimeScenePreEvents: RuntimeSceneCallback[] = []
    callbacksRuntimeSceneResumed: RuntimeSceneCallback[] = []
    callbacksRuntimeSceneUnloaded: RuntimeSceneCallback[] = []
    callbacksRuntimeSceneUnloading: RuntimeSceneCallback[] = []
    gdevelopLogo: string = ''
    +
    VideoRuntimeObjectRenderer: VideoRuntimeObjectPixiRenderer

    Variables

    BBTextRuntimeObjectRenderer: typeof BBTextRuntimeObjectPixiRenderer = BBTextRuntimeObjectPixiRenderer
    BitmapFontManager: typeof PixiBitmapFontManager = gdjs.PixiBitmapFontManager
    BitmapTextRuntimeObjectRenderer: typeof BitmapTextRuntimeObjectPixiRenderer = BitmapTextRuntimeObjectPixiRenderer
    Cube3DRuntimeObjectRenderer: typeof Cube3DRuntimeObjectPixiRenderer = Cube3DRuntimeObjectPixiRenderer
    CustomRuntimeObject2DRenderer: typeof CustomRuntimeObject2DPixiRenderer
    DebuggerClient: typeof WebsocketDebuggerClient = WebsocketDebuggerClient
    DebuggerRenderer: typeof DebuggerPixiRenderer
    DummyRuntimeObjectRenderer: typeof DummyRuntimeObjectPixiRenderer = DummyRuntimeObjectPixiRenderer
    EffectsManager: typeof PixiEffectsManager = PixiEffectsManager
    FontManager: typeof FontFaceObserverFontManager
    ImageManager: typeof PixiImageManager = gdjs.PixiImageManager
    LayerRenderer: typeof LayerPixiRenderer
    LightRuntimeObjectRenderer: typeof LightRuntimeObjectPixiRenderer = LightRuntimeObjectPixiRenderer
    LoadingScreenRenderer: typeof LoadingScreenPixiRenderer = LoadingScreenPixiRenderer
    Model3DRuntimeObjectRenderer: typeof Model3DRuntimeObject3DRenderer = Model3DRuntimeObject3DRenderer
    PanelSpriteRuntimeObjectRenderer: typeof PanelSpriteRuntimeObjectPixiRenderer = PanelSpriteRuntimeObjectPixiRenderer
    ParticleEmitterObjectRenderer: typeof ParticleEmitterObjectPixiRenderer = ParticleEmitterObjectPixiRenderer
    RuntimeGameRenderer: typeof RuntimeGamePixiRenderer
    RuntimeSceneRenderer: typeof RuntimeScenePixiRenderer
    ShapePainterRuntimeObjectRenderer: typeof ShapePainterRuntimeObjectPixiRenderer = ShapePainterRuntimeObjectPixiRenderer
    SoundManager: typeof HowlerSoundManager = HowlerSoundManager
    SpineRuntimeObjectRenderer: typeof SpineRuntimeObjectPixiRenderer = SpineRuntimeObjectPixiRenderer
    SpriteRuntimeObjectRenderer: typeof SpriteRuntimeObjectPixiRenderer = SpriteRuntimeObjectPixiRenderer
    TextEntryRuntimeObjectRenderer: typeof TextEntryRuntimeObjectPixiRenderer = TextEntryRuntimeObjectPixiRenderer
    TextInputRuntimeObjectRenderer: typeof TextInputRuntimeObjectPixiRenderer = TextInputRuntimeObjectPixiRenderer
    TextRuntimeObjectRenderer: typeof TextRuntimeObjectPixiRenderer = TextRuntimeObjectPixiRenderer
    TileMapRuntimeObjectRenderer: typeof TileMapRuntimeObjectPixiRenderer = gdjs.TileMapRuntimeObjectPixiRenderer
    TiledSpriteRuntimeObjectRenderer: typeof TiledSpriteRuntimeObjectPixiRenderer = TiledSpriteRuntimeObjectPixiRenderer
    VideoRuntimeObjectRenderer: typeof VideoRuntimeObjectPixiRenderer = VideoRuntimeObjectPixiRenderer
    behaviorsTypes: Hashtable<typeof RuntimeBehavior> = ...
    callbacksFirstRuntimeSceneLoaded: RuntimeSceneCallback[] = []
    callbacksObjectDeletedFromScene: RuntimeSceneRuntimeObjectCallback[] = []
    callbacksRuntimeSceneLoaded: RuntimeSceneCallback[] = []
    callbacksRuntimeScenePaused: RuntimeSceneCallback[] = []
    callbacksRuntimeScenePostEvents: RuntimeSceneCallback[] = []
    callbacksRuntimeScenePreEvents: RuntimeSceneCallback[] = []
    callbacksRuntimeSceneResumed: RuntimeSceneCallback[] = []
    callbacksRuntimeSceneUnloaded: RuntimeSceneCallback[] = []
    callbacksRuntimeSceneUnloading: RuntimeSceneCallback[] = []
    gdevelopLogo: string = ''

    Base64 encoded logo of GDevelop for the splash screen.

    -
    makeUuid: MakeUUID = ...
    +
    makeUuid: MakeUUID = ...

    Generate a UUID v4.

    returns

    The generated UUID.

    -
    multiplayerMessageManager: { addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void; clearDisconnectedPeers: () => void; clearExpectedMessageAcknowledgements: () => void; createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }; createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }; createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string; createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string; createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }; createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }; createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string; getCurrentPlayerPing: () => number; getCustomMessageData: (userMessageName: string) => any; getCustomMessageSender: (userMessageName: string) => number; getDisconnectedPlayers: () => number[]; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void; handleAcknowledgeMessagesReceived: () => void; handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleCustomMessagesReceived: () => void; handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void; handleEndGameMessages: () => void; handleHeartbeatsReceived: () => void; handleHeartbeatsToSend: () => void; handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void; handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void; hasAnyPlayerLeft: () => boolean; hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendCustomMessage: (userMessageName: string, userMessageData: any) => void; sendDataTo: (peerIds: string[], messageName: string, data: object) => void; sendEndGameMessage: () => void; sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void; updatePlayersPingsForTests: (playersPings: any) => void } = ...
    +
    multiplayerMessageManager: { addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void; clearDisconnectedPeers: () => void; clearExpectedMessageAcknowledgements: () => void; createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }; createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }; createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string; createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string; createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }; createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }; createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string; getCurrentPlayerPing: () => number; getCustomMessageData: (userMessageName: string) => any; getCustomMessageSender: (userMessageName: string) => number; getDisconnectedPlayers: () => number[]; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void; handleAcknowledgeMessagesReceived: () => void; handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleCustomMessagesReceived: () => void; handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void; handleEndGameMessages: () => void; handleHeartbeatsReceived: () => void; handleHeartbeatsToSend: () => void; handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void; handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void; hasAnyPlayerLeft: () => boolean; hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendCustomMessage: (userMessageName: string, userMessageData: any) => void; sendDataTo: (peerIds: string[], messageName: string, data: object) => void; sendEndGameMessage: () => void; sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void; updatePlayersPingsForTests: (playersPings: any) => void } = ...

    The MultiplayerMessageManager used by the game.

    Type declaration

    • addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void
        • (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }): void
        • Parameters

          • __namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }
            • expectedMessageName: string
            • Optional maxNumberOfRetries?: number
            • Optional messageRetryTime?: number
            • originalData: any
            • originalMessageName: string
            • otherPeerIds: string[]
            • shouldCancelMessageIfTimesOut: boolean

          Returns void

    • clearDisconnectedPeers: () => void
        • (): void
        • Returns void

    • clearExpectedMessageAcknowledgements: () => void
        • (): void
        • Returns void

    • createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }
        • (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }): { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }
        • Parameters

          • __namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }
            • instanceNetworkId: string
            • instanceX: number
            • instanceY: number
            • newObjectOwner: number
            • objectName: string
            • objectOwner: number
            • sceneNetworkId: string

          Returns { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }

          • messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }
            • instanceX: number
            • instanceY: number
            • newOwner: number
            • previousOwner: number
            • sceneNetworkId: string
          • messageName: string
    • createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }
        • (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }): { messageData: { newOwner: number; previousOwner: number }; messageName: string }
        • Parameters

          • __namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }
            • newVariableOwner: number
            • variableNetworkId: string
            • variableOwner: number

          Returns { messageData: { newOwner: number; previousOwner: number }; messageName: string }

          • messageData: { newOwner: number; previousOwner: number }
            • newOwner: number
            • previousOwner: number
          • messageName: string
    • createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }
        • (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }): { messageData: any; messageName: string }
        • Parameters

          • __namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }
            • instanceNetworkId: string
            • objectName: string
            • objectOwner: number
            • sceneNetworkId: string

          Returns { messageData: any; messageName: string }

          • messageData: any
          • messageName: string
    • createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string
        • (messageName: string): string
        • Parameters

          • messageName: string

          Returns string

    • createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string
        • (messageName: string): string
        • Parameters

          • messageName: string

          Returns string

    • createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }
        • (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }): { messageData: any; messageName: string }
        • Parameters

          • __namedParameters: { gameNetworkSyncData: GameNetworkSyncData }
            • gameNetworkSyncData: GameNetworkSyncData

          Returns { messageData: any; messageName: string }

          • messageData: any
          • messageName: string
    • createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }
        • (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }): { messageData: any; messageName: string }
        • Parameters

          • __namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }
            • instanceNetworkId: string
            • objectName: string
            • objectNetworkSyncData: ObjectNetworkSyncData
            • objectOwner: number
            • sceneNetworkId: string

          Returns { messageData: any; messageName: string }

          • messageData: any
          • messageName: string
    • createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }
        • (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }): { messageData: LayoutNetworkSyncData; messageName: string }
        • Parameters

          • __namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }
            • sceneNetworkSyncData: LayoutNetworkSyncData

          Returns { messageData: LayoutNetworkSyncData; messageName: string }

          • messageData: LayoutNetworkSyncData
          • messageName: string
    • createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string
        • (messageName: string): string
        • Parameters

          • messageName: string

          Returns string

    • getCurrentPlayerPing: () => number
        • (): number
        • Returns number

    • getCustomMessageData: (userMessageName: string) => any
        • (userMessageName: string): any
        • Parameters

          • userMessageName: string

          Returns any

    • getCustomMessageSender: (userMessageName: string) => number
        • (userMessageName: string): number
        • Parameters

          • userMessageName: string

          Returns number

    • getDisconnectedPlayers: () => number[]
        • (): number[]
        • Returns number[]

    • getNumberOfConnectedPlayers: () => number
        • (): number
        • Returns number

    • getPlayerPing: (playerNumber: number) => number
        • (playerNumber: number): number
        • Parameters

          • playerNumber: number

          Returns number

    • getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void
        • (userMessageName: string, variable: Variable): void
        • Parameters

          • userMessageName: string
          • variable: Variable

          Returns void

    • handleAcknowledgeMessagesReceived: () => void
        • (): void
        • Returns void

    • handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void
    • handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void
    • handleCustomMessagesReceived: () => void
        • (): void
        • Returns void

    • handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void
    • handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void
    • handleEndGameMessages: () => void
        • (): void
        • Returns void

    • handleHeartbeatsReceived: () => void
        • (): void
        • Returns void

    • handleHeartbeatsToSend: () => void
        • (): void
        • Returns void

    • handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void
    • handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void
    • handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void
    • handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void
    • handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void
    • hasAnyPlayerLeft: () => boolean
        • (): boolean
        • Returns boolean

    • hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false
        • (userMessageName: string): undefined | false
        • Parameters

          • userMessageName: string

          Returns undefined | false

    • hasPlayerLeft: (playerNumber: number) => boolean
        • (playerNumber: number): boolean
        • Parameters

          • playerNumber: number

          Returns boolean

    • isPlayerConnected: (playerNumber: number) => boolean
        • (playerNumber: number): boolean
        • Parameters

          • playerNumber: number

          Returns boolean

    • resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void
    • sendCustomMessage: (userMessageName: string, userMessageData: any) => void
        • (userMessageName: string, userMessageData: any): void
        • Parameters

          • userMessageName: string
          • userMessageData: any

          Returns void

    • sendDataTo: (peerIds: string[], messageName: string, data: object) => void
        • (peerIds: string[], messageName: string, data: object): void
        • Main function to send messages to other players, via P2P. Takes into account the simulation of network latency and packet loss.

          -

          Parameters

          • peerIds: string[]
          • messageName: string
          • data: object

          Returns void

    • sendEndGameMessage: () => void
        • (): void
        • Returns void

    • sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void
        • (userMessageName: string, variable: Variable): void
        • Parameters

          • userMessageName: string
          • variable: Variable

          Returns void

    • updatePlayersPingsForTests: (playersPings: any) => void
        • (playersPings: any): void
        • Parameters

          • playersPings: any

          Returns void

    multiplayerVariablesManager: { disableVariableSynchronization: (runtimeScene: RuntimeScene, variable: Variable) => void; getPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => null | number; getVariableTypeAndNameFromNetworkId: (variableNetworkId: string) => { containerId: string; name: string; type: string }; handleChangeVariableOwnerMessagesToSend: () => void; removeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void; setPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable, newVariablePlayerNumber: number) => void; takeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void } = ...
    +

    Parameters

    • peerIds: string[]
    • messageName: string
    • data: object

    Returns void

  • sendEndGameMessage: () => void
      • (): void
      • Returns void

  • sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void
      • (userMessageName: string, variable: Variable): void
      • Parameters

        • userMessageName: string
        • variable: Variable

        Returns void

  • updatePlayersPingsForTests: (playersPings: any) => void
      • (playersPings: any): void
      • Parameters

        • playersPings: any

        Returns void

  • multiplayerVariablesManager: { disableVariableSynchronization: (runtimeScene: RuntimeScene, variable: Variable) => void; getPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => null | number; getVariableTypeAndNameFromNetworkId: (variableNetworkId: string) => { containerId: string; name: string; type: string }; handleChangeVariableOwnerMessagesToSend: () => void; removeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void; setPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable, newVariablePlayerNumber: number) => void; takeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void } = ...

    The MultiplayerVariablesManager used by the game.

    -

    Type declaration

    • disableVariableSynchronization: (runtimeScene: RuntimeScene, variable: Variable) => void
    • getPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => null | number
    • getVariableTypeAndNameFromNetworkId: (variableNetworkId: string) => { containerId: string; name: string; type: string }
        • (variableNetworkId: string): { containerId: string; name: string; type: string }
        • Parameters

          • variableNetworkId: string

          Returns { containerId: string; name: string; type: string }

          • containerId: string
          • name: string
          • type: string
    • handleChangeVariableOwnerMessagesToSend: () => void
        • (): void
        • Returns void

    • removeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void
    • setPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable, newVariablePlayerNumber: number) => void
    • takeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void
    objectsTypes: Hashtable<typeof RuntimeObject> = ...
    projectData: ProjectData
    runtimeGameOptions: RuntimeGameOptions

    Functions

    • copyArray<T>(src: T[], dst: T[]): void
    objectsTypes: Hashtable<typeof RuntimeObject> = ...
    projectData: ProjectData
    runtimeGameOptions: RuntimeGameOptions

    Functions

    • copyArray<T>(src: T[], dst: T[]): void
    • Copy the element for the first array into the second array, so that both array contains the same elements.

      Type parameters

      • T

      Parameters

      • src: T[]

        The source array

      • dst: T[]

        The destination array

        -

      Returns void

    • getAllAsynchronouslyLoadingLibraryPromise(): Promise<any[]>
    • Returns Promise<any[]>

      a promise resolved when all all third party libraries, which need +

    Returns void

    • getAllAsynchronouslyLoadingLibraryPromise(): Promise<any[]>
    • Returns Promise<any[]>

      a promise resolved when all all third party libraries, which need to be loaded before the game startup, are loaded. If a library fails loading, this will be rejected.

      -

    Returns typeof RuntimeBehavior

    • hexNumberToRGB(hexNumber: number): { a: number; b: number; g: number; r: number }

    Returns typeof RuntimeObject

    • hexNumberToRGB(hexNumber: number): { a: number; b: number; g: number; r: number }
    • Convert a Hex number to a RGB color object ({r,g,b,a} with each component going from 0 to 255 and alpha set to 255).

      -

      Parameters

      • hexNumber: number

      Returns { a: number; b: number; g: number; r: number }

      • a: number
      • b: number
      • g: number
      • r: number
    • hexNumberToRGBArray(hexNumber: number): [number, number, number]
    • +

      Parameters

      • hexNumber: number

      Returns { a: number; b: number; g: number; r: number }

      • a: number
      • b: number
      • g: number
      • r: number
    • hexNumberToRGBArray(hexNumber: number): [number, number, number]
    • Convert a Hex number to a RGB color array([r,g,b] with each component going from 0 to 255).

      -

      Parameters

      • hexNumber: number

      Returns [number, number, number]

    • hexToRGBColor(hexString: string): [number, number, number]
    • hexToRGBColor(hexString: string): [number, number, number]
    • Convert a Hex string to an RGB color array [r, g, b], where each component is in the range [0, 255].

      -

      Parameters

      • hexString: string

      Returns [number, number, number]

    • makeMultiplayerMessageManager(): { addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void; clearDisconnectedPeers: () => void; clearExpectedMessageAcknowledgements: () => void; createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }; createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }; createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string; createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string; createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }; createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }; createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string; getCurrentPlayerPing: () => number; getCustomMessageData: (userMessageName: string) => any; getCustomMessageSender: (userMessageName: string) => number; getDisconnectedPlayers: () => number[]; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void; handleAcknowledgeMessagesReceived: () => void; handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleCustomMessagesReceived: () => void; handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void; handleEndGameMessages: () => void; handleHeartbeatsReceived: () => void; handleHeartbeatsToSend: () => void; handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void; handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void; hasAnyPlayerLeft: () => boolean; hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendCustomMessage: (userMessageName: string, userMessageData: any) => void; sendDataTo: (peerIds: string[], messageName: string, data: object) => void; sendEndGameMessage: () => void; sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void; updatePlayersPingsForTests: (playersPings: any) => void }
    • makeMultiplayerMessageManager(): { addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void; clearDisconnectedPeers: () => void; clearExpectedMessageAcknowledgements: () => void; createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }; createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }; createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string; createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string; createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }; createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }; createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string; getCurrentPlayerPing: () => number; getCustomMessageData: (userMessageName: string) => any; getCustomMessageSender: (userMessageName: string) => number; getDisconnectedPlayers: () => number[]; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void; handleAcknowledgeMessagesReceived: () => void; handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleCustomMessagesReceived: () => void; handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void; handleEndGameMessages: () => void; handleHeartbeatsReceived: () => void; handleHeartbeatsToSend: () => void; handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void; handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void; hasAnyPlayerLeft: () => boolean; hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendCustomMessage: (userMessageName: string, userMessageData: any) => void; sendDataTo: (peerIds: string[], messageName: string, data: object) => void; sendEndGameMessage: () => void; sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void; updatePlayersPingsForTests: (playersPings: any) => void }
    • Create a new MultiplayerMessageManager.

      In most cases, you should use the default gdjs.multiplayerMessageManager instead.

      Returns { addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void; clearDisconnectedPeers: () => void; clearExpectedMessageAcknowledgements: () => void; createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }; createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }; createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string; createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string; createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }; createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }; createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }; createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string; getCurrentPlayerPing: () => number; getCustomMessageData: (userMessageName: string) => any; getCustomMessageSender: (userMessageName: string) => number; getDisconnectedPlayers: () => number[]; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void; handleAcknowledgeMessagesReceived: () => void; handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void; handleCustomMessagesReceived: () => void; handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void; handleEndGameMessages: () => void; handleHeartbeatsReceived: () => void; handleHeartbeatsToSend: () => void; handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void; handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void; handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void; hasAnyPlayerLeft: () => boolean; hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendCustomMessage: (userMessageName: string, userMessageData: any) => void; sendDataTo: (peerIds: string[], messageName: string, data: object) => void; sendEndGameMessage: () => void; sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void; updatePlayersPingsForTests: (playersPings: any) => void }

      • addExpectedMessageAcknowledgement: (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }) => void
          • (__namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }): void
          • Parameters

            • __namedParameters: { expectedMessageName: string; maxNumberOfRetries?: number; messageRetryTime?: number; originalData: any; originalMessageName: string; otherPeerIds: string[]; shouldCancelMessageIfTimesOut: boolean }
              • expectedMessageName: string
              • Optional maxNumberOfRetries?: number
              • Optional messageRetryTime?: number
              • originalData: any
              • originalMessageName: string
              • otherPeerIds: string[]
              • shouldCancelMessageIfTimesOut: boolean

            Returns void

      • clearDisconnectedPeers: () => void
          • (): void
          • Returns void

      • clearExpectedMessageAcknowledgements: () => void
          • (): void
          • Returns void

      • createChangeInstanceOwnerMessage: (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }
          • (__namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }): { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }
          • Parameters

            • __namedParameters: { instanceNetworkId: string; instanceX: number; instanceY: number; newObjectOwner: number; objectName: string; objectOwner: number; sceneNetworkId: string }
              • instanceNetworkId: string
              • instanceX: number
              • instanceY: number
              • newObjectOwner: number
              • objectName: string
              • objectOwner: number
              • sceneNetworkId: string

            Returns { messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }; messageName: string }

            • messageData: { instanceX: number; instanceY: number; newOwner: number; previousOwner: number; sceneNetworkId: string }
              • instanceX: number
              • instanceY: number
              • newOwner: number
              • previousOwner: number
              • sceneNetworkId: string
            • messageName: string
      • createChangeVariableOwnerMessage: (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }) => { messageData: { newOwner: number; previousOwner: number }; messageName: string }
          • (__namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }): { messageData: { newOwner: number; previousOwner: number }; messageName: string }
          • Parameters

            • __namedParameters: { newVariableOwner: number; variableNetworkId: string; variableOwner: number }
              • newVariableOwner: number
              • variableNetworkId: string
              • variableOwner: number

            Returns { messageData: { newOwner: number; previousOwner: number }; messageName: string }

            • messageData: { newOwner: number; previousOwner: number }
              • newOwner: number
              • previousOwner: number
            • messageName: string
      • createDestroyInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }
          • (__namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }): { messageData: any; messageName: string }
          • Parameters

            • __namedParameters: { instanceNetworkId: string; objectName: string; objectOwner: number; sceneNetworkId: string }
              • instanceNetworkId: string
              • objectName: string
              • objectOwner: number
              • sceneNetworkId: string

            Returns { messageData: any; messageName: string }

            • messageData: any
            • messageName: string
      • createInstanceDestroyedMessageNameFromDestroyInstanceMessage: (messageName: string) => string
          • (messageName: string): string
          • Parameters

            • messageName: string

            Returns string

      • createInstanceOwnerChangedMessageNameFromChangeInstanceOwnerMessage: (messageName: string) => string
          • (messageName: string): string
          • Parameters

            • messageName: string

            Returns string

      • createUpdateGameMessage: (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }) => { messageData: any; messageName: string }
          • (__namedParameters: { gameNetworkSyncData: GameNetworkSyncData }): { messageData: any; messageName: string }
          • Parameters

            • __namedParameters: { gameNetworkSyncData: GameNetworkSyncData }
              • gameNetworkSyncData: GameNetworkSyncData

            Returns { messageData: any; messageName: string }

            • messageData: any
            • messageName: string
      • createUpdateInstanceMessage: (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }) => { messageData: any; messageName: string }
          • (__namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }): { messageData: any; messageName: string }
          • Parameters

            • __namedParameters: { instanceNetworkId: string; objectName: string; objectNetworkSyncData: ObjectNetworkSyncData; objectOwner: number; sceneNetworkId: string }
              • instanceNetworkId: string
              • objectName: string
              • objectNetworkSyncData: ObjectNetworkSyncData
              • objectOwner: number
              • sceneNetworkId: string

            Returns { messageData: any; messageName: string }

            • messageData: any
            • messageName: string
      • createUpdateSceneMessage: (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }) => { messageData: LayoutNetworkSyncData; messageName: string }
          • (__namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }): { messageData: LayoutNetworkSyncData; messageName: string }
          • Parameters

            • __namedParameters: { sceneNetworkSyncData: LayoutNetworkSyncData }
              • sceneNetworkSyncData: LayoutNetworkSyncData

            Returns { messageData: LayoutNetworkSyncData; messageName: string }

            • messageData: LayoutNetworkSyncData
            • messageName: string
      • createVariableOwnerChangedMessageNameFromChangeVariableOwnerMessage: (messageName: string) => string
          • (messageName: string): string
          • Parameters

            • messageName: string

            Returns string

      • getCurrentPlayerPing: () => number
          • (): number
          • Returns number

      • getCustomMessageData: (userMessageName: string) => any
          • (userMessageName: string): any
          • Parameters

            • userMessageName: string

            Returns any

      • getCustomMessageSender: (userMessageName: string) => number
          • (userMessageName: string): number
          • Parameters

            • userMessageName: string

            Returns number

      • getDisconnectedPlayers: () => number[]
          • (): number[]
          • Returns number[]

      • getNumberOfConnectedPlayers: () => number
          • (): number
          • Returns number

      • getPlayerPing: (playerNumber: number) => number
          • (playerNumber: number): number
          • Parameters

            • playerNumber: number

            Returns number

      • getVariableCustomMessageData: (userMessageName: string, variable: Variable) => void
          • (userMessageName: string, variable: Variable): void
          • Parameters

            • userMessageName: string
            • variable: Variable

            Returns void

      • handleAcknowledgeMessagesReceived: () => void
          • (): void
          • Returns void

      • handleChangeInstanceOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void
      • handleChangeVariableOwnerMessagesReceived: (runtimeScene: RuntimeScene) => void
      • handleCustomMessagesReceived: () => void
          • (): void
          • Returns void

      • handleDestroyInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void
      • handleDisconnectedPeers: (runtimeScene: RuntimeScene) => void
      • handleEndGameMessages: () => void
          • (): void
          • Returns void

      • handleHeartbeatsReceived: () => void
          • (): void
          • Returns void

      • handleHeartbeatsToSend: () => void
          • (): void
          • Returns void

      • handleUpdateGameMessagesReceived: (runtimeScene: RuntimeScene) => void
      • handleUpdateGameMessagesToSend: (runtimeScene: RuntimeScene) => void
      • handleUpdateInstanceMessagesReceived: (runtimeScene: RuntimeScene) => void
      • handleUpdateSceneMessagesReceived: (runtimeScene: RuntimeScene) => void
      • handleUpdateSceneMessagesToSend: (runtimeScene: RuntimeScene) => void
      • hasAnyPlayerLeft: () => boolean
          • (): boolean
          • Returns boolean

      • hasCustomMessageBeenReceived: (userMessageName: string) => undefined | false
          • (userMessageName: string): undefined | false
          • Parameters

            • userMessageName: string

            Returns undefined | false

      • hasPlayerLeft: (playerNumber: number) => boolean
          • (playerNumber: number): boolean
          • Parameters

            • playerNumber: number

            Returns boolean

      • isPlayerConnected: (playerNumber: number) => boolean
          • (playerNumber: number): boolean
          • Parameters

            • playerNumber: number

            Returns boolean

      • resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void
      • sendCustomMessage: (userMessageName: string, userMessageData: any) => void
          • (userMessageName: string, userMessageData: any): void
          • Parameters

            • userMessageName: string
            • userMessageData: any

            Returns void

      • sendDataTo: (peerIds: string[], messageName: string, data: object) => void
          • (peerIds: string[], messageName: string, data: object): void
          • Main function to send messages to other players, via P2P. Takes into account the simulation of network latency and packet loss.

            -

            Parameters

            • peerIds: string[]
            • messageName: string
            • data: object

            Returns void

      • sendEndGameMessage: () => void
          • (): void
          • Returns void

      • sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void
          • (userMessageName: string, variable: Variable): void
          • Parameters

            • userMessageName: string
            • variable: Variable

            Returns void

      • updatePlayersPingsForTests: (playersPings: any) => void
          • (playersPings: any): void
          • Parameters

            • playersPings: any

            Returns void

    • makeMultiplayerVariablesManager(): { disableVariableSynchronization: (runtimeScene: RuntimeScene, variable: Variable) => void; getPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => null | number; getVariableTypeAndNameFromNetworkId: (variableNetworkId: string) => { containerId: string; name: string; type: string }; handleChangeVariableOwnerMessagesToSend: () => void; removeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void; setPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable, newVariablePlayerNumber: number) => void; takeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void }
    • nearlyEqual(a: number, b: number, epsilon: number): boolean
  • sendEndGameMessage: () => void
      • (): void
      • Returns void

  • sendVariableCustomMessage: (userMessageName: string, variable: Variable) => void
      • (userMessageName: string, variable: Variable): void
      • Parameters

        • userMessageName: string
        • variable: Variable

        Returns void

  • updatePlayersPingsForTests: (playersPings: any) => void
      • (playersPings: any): void
      • Parameters

        • playersPings: any

        Returns void

    • makeMultiplayerVariablesManager(): { disableVariableSynchronization: (runtimeScene: RuntimeScene, variable: Variable) => void; getPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => null | number; getVariableTypeAndNameFromNetworkId: (variableNetworkId: string) => { containerId: string; name: string; type: string }; handleChangeVariableOwnerMessagesToSend: () => void; removeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void; setPlayerVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable, newVariablePlayerNumber: number) => void; takeVariableOwnership: (runtimeScene: RuntimeScene, variable: Variable) => void }
    • nearlyEqual(a: number, b: number, epsilon: number): boolean
    • random(max: number): number
    • random(max: number): number
    • Get a random integer between 0 and max.

      Parameters

      • max: number

        The maximum value (inclusive).

        -

      Returns number

    • randomFloat(max: number): number

    Returns number

    • randomFloat(max: number): number
    • Get a random float in the range 0 to less than max (inclusive of 0, but not max).

      Parameters

      • max: number

        The maximum value (exclusive).

        -

      Returns number

    • randomFloatInRange(min: number, max: number): number

    Returns number

    • randomFloatInRange(min: number, max: number): number
    • Get a random float between min and max

      Parameters

      • min: number

        The minimum value (inclusive).

      • max: number

        The maximum value (exclusive).

        -

      Returns number

    • randomInRange(min: number, max: number): number

    Returns number

    • randomInRange(min: number, max: number): number
    • Get a random integer between min and max.

      Parameters

      • min: number

        The minimum value (inclusive).

      • max: number

        The maximum value (inclusive).

        -

      Returns number

    • randomWithStep(min: number, max: number, step: number): number

    Returns number

    • randomWithStep(min: number, max: number, step: number): number
    • Get a random number between min and max in steps

      Parameters

      • min: number

        The minimum value (inclusive).

        @@ -337,11 +337,11 @@

        The maximum value (inclusive).

      • step: number

        The interval between each value.

        -

      Returns number

    • registerAsynchronouslyLoadingLibraryPromise(promise: Promise<any>): void

    Returns number

    • registerAsynchronouslyLoadingLibraryPromise(promise: Promise<any>): void
    • Register a promise which will be resolved when a third party library has finished loading (and is required to load before launching the game).

      This method must be called by any library that loads asynchronously.

      -

      Parameters

      • promise: Promise<any>

      Returns void

    • registerBehavior(behaviorTypeName: string, Ctor: typeof RuntimeBehavior): void
    • registerBehavior(behaviorTypeName: string, Ctor: typeof RuntimeBehavior): void

    Returns void

    • registerFirstRuntimeSceneLoadedCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerFirstRuntimeSceneLoadedCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called when the first gdjs.RuntimeScene is loaded, after resources loading is done. This can be considered as the "start of the game".

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerObject(objectTypeName: string, Ctor: typeof RuntimeObject): void

    Returns void

    • registerObject(objectTypeName: string, Ctor: typeof RuntimeObject): void
    • Register a runtime object (class extending gdjs.RuntimeObject) that can be used in a scene.

      The name of the type of the object must be complete, with the namespace if any. For example, if you are providing a Text object in the TextObject extension, the full name @@ -365,54 +365,54 @@

      The name of the type of the Object.

    • Ctor: typeof RuntimeObject

      The constructor of the Object.

      -

    Returns void

    • registerObjectDeletedFromSceneCallback(callback: RuntimeSceneRuntimeObjectCallback): void

    Returns void

    • registerObjectDeletedFromSceneCallback(callback: RuntimeSceneRuntimeObjectCallback): void
    • Register a function to be called when an object is deleted from a scene.

      Parameters

      • callback: RuntimeSceneRuntimeObjectCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeSceneLoadedCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeSceneLoadedCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called when a scene is loaded.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeScenePausedCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeScenePausedCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called when a scene is paused.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeScenePostEventsCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeScenePostEventsCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called each time a scene is stepped (i.e: at every frame), after events are run and before rendering.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeScenePreEventsCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeScenePreEventsCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called each time a scene is stepped (i.e: at every frame), before events are run.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeSceneResumedCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeSceneResumedCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called when a scene is resumed.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeSceneUnloadedCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeSceneUnloadedCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called when a scene is unloaded. The objects and renderer are now destroyed - it is not safe to do anything apart from releasing resources.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • registerRuntimeSceneUnloadingCallback(callback: RuntimeSceneCallback): void

    Returns void

    • registerRuntimeSceneUnloadingCallback(callback: RuntimeSceneCallback): void
    • Register a function to be called when a scene unload started. This is before the object deletion and renderer destruction. It is safe to manipulate these. It is not be safe to release resources as other callbacks might do operations on objects or the scene.

      Parameters

      • callback: RuntimeSceneCallback

        The function to be called.

        -

      Returns void

    • rgbOrHexStringToNumber(rgbOrHexString: string): number

    Returns void

    • rgbOrHexStringToNumber(rgbOrHexString: string): number
    • Convert a RGB string ("rrr;ggg;bbb") or a Hex string ("#rrggbb") to a RGB color number.

      Parameters

      • rgbOrHexString: string

        The color as a RGB string or Hex string

        -

      Returns number

    • rgbOrHexToRGBColor(value: string): [number, number, number]

    Returns number

    • rgbOrHexToRGBColor(value: string): [number, number, number]
    • Convert a RGB string ("rrr;ggg;bbb") or a Hex string ("#rrggbb") to a RGB color array ([r,g,b] with each component going from 0 to 255).

      Parameters

      • value: string

        The color as a RGB string or Hex string

        -

      Returns [number, number, number]

    • rgbToHex(r: number, g: number, b: number): string

    Returns [number, number, number]

    • rgbToHex(r: number, g: number, b: number): string
    • Convert a RGB object to a Hex string.

      No "#" or "0x" are added.

      Parameters

      • r: number
        @@ -421,7 +421,7 @@

        Green

      • b: number

        Blue

        -

      Returns string

    • rgbToHexNumber(r: number, g: number, b: number): number

    Returns string

    • rgbToHexNumber(r: number, g: number, b: number): number
    • Convert a RGB object to a Hex number.

      Parameters

      • r: number

        Red

        @@ -429,27 +429,27 @@

        Green

      • b: number

        Blue

        -

      Returns number

    • staticArray(owner: any): any[]

    Returns number

    • staticArray(owner: any): any[]
    • Create a static array that won't need a new allocation each time it's used.

      Parameters

      • owner: any

        The owner of the Array.

        -

      Returns any[]

    • staticArray2(owner: any): any[]

    Returns any[]

    • staticArray2(owner: any): any[]
    • Create a second static array that won't need a new allocation each time it's used.

      Parameters

      • owner: any

        The owner of the Array.

        -

      Returns any[]

    • staticObject(owner: any): Object

    Returns any[]

    • staticObject(owner: any): Object
    • Create a static object that won't need a new allocation each time it's used.

      Parameters

      • owner: any

        The owner of the Array.

        -

      Returns Object

    • toDegrees(angleInRadians: number): number

    Returns Object

    • toDegrees(angleInRadians: number): number
    • Convert an angle in radians to degrees.

      Parameters

      • angleInRadians: number

        The angle in radians.

        -

      Returns number

    • toRad(angleInDegrees: number): number

    Returns number

    • toRad(angleInDegrees: number): number
    • Convert an angle in degrees to radians.

      Parameters

      • angleInDegrees: number

        The angle in degrees.

        -

      Returns number

    • registerGlobalCallbacks(): void

    Returns number

    • registerGlobalCallbacks(): void
    • Keep this function until we're sure now client is using it anymore.

      deprecated

      Returns void

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Variables

    disableMultiplayerForTesting: boolean = false
    +multiplayer | GDevelop JavaScript game engine
    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Variables

    disableMultiplayerForTesting: boolean = false

    Set to true in testing to avoid relying on the multiplayer extension.

    -
    playerNumber: number | null = null

    Functions

    • endLobbyGame(): Promise<void>
    playerNumber: number | null = null

    Functions

    • endLobbyGame(): Promise<void>
    • getCurrentPlayerNumber(): number
    • getCurrentPlayerNumber(): number
    • getCurrentPlayerUsername(): undefined | string
    • getCurrentPlayerUsername(): undefined | string
    • getPlayerUsername(playerNumber: number): undefined | string
    • getPlayerUsername(playerNumber: number): undefined | string
    • Returns the player username at the given number in the lobby. The number is shifted by one, so that the first player has number 1.

      -

      Parameters

      • playerNumber: number

      Returns undefined | string

    • getPlayersInLobbyCount(): number
    • getPlayersInLobbyCount(): number
    • handleLobbyGameEnded(): void
    • handleLobbyGameEnded(): void
    • hasLobbyGameJustEnded(): boolean
    • hasLobbyGameJustEnded(): boolean
    • hasLobbyGameJustStarted(): boolean
    • hasLobbyGameJustStarted(): boolean
    • isLobbyGameRunning(): boolean
    • isPlayerHost(): boolean
    • isLobbyGameRunning(): boolean
    • isPlayerHost(): boolean
    • openLobbiesWindow(runtimeScene: RuntimeScene): Promise<void>
    • openLobbiesWindow(runtimeScene: RuntimeScene): Promise<void>
    • showLobbiesCloseButton(runtimeScene: RuntimeScene, visible: boolean): void

    Settings

    Theme

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    • addReloadUrlToTextsContainer(onClick: () => void, textContainer: HTMLDivElement): void
    • getAllPeers(): string[]
    • getCurrentId(): string
    • getCurrentId(): string
    • getJustDisconnectedPeers(): string[]
    • getJustDisconnectedPeers(): string[]
    • isReady(): boolean
    • isReady(): boolean
    • sendDataTo(ids: string[], messageName: string, messageData: object): Promise<void>
    • sendDataTo(ids: string[], messageName: string, messageData: object): Promise<void>
    • Send a message to a specific peer.

      Parameters

      • ids: string[]

        The IDs of the clients to send the event to.

      • messageName: string

        The event to trigger.

        -
      • messageData: object

      Returns Promise<void>

    • useCustomBrokerServer(host: string, port: number, path: string, key: string, ssl: boolean): void

    Returns Promise<void>

    • useCustomBrokerServer(host: string, port: number, path: string, key: string, ssl: boolean): void
    • Connects to a custom broker server.

      Parameters

      • host: string

        The host of the broker server.

        @@ -38,7 +38,7 @@

        Optional password to connect to the broker server.

      • ssl: boolean

        Use ssl?

        -

      Returns void

    • useCustomICECandidate(urls: string, username?: string, credential?: string): void

    Returns void

    • useCustomICECandidate(urls: string, username?: string, credential?: string): void
    • Adds an ICE server candidate, and removes the default ones provided by PeerJs. Must be called before connecting to a broker.

      Parameters

      • urls: string

        The URL of the STUN/TURN server.

        @@ -46,7 +46,7 @@

        An optional username to send to the server.

      • Optional credential: string

        An optional password to send to the server.

        -

      Returns void

    • useDefaultBrokerServer(): void

    Settings

    Theme

    Generated using TypeDoc

    Options
    All
    • Public
    • Public/Protected
    • All
    Menu

    Index

    Functions

    • getPointSegmentDistanceSq(px: number, py: number, ax: number, ay: number, bx: number, by: number): number
    • simplifyPath(sourceVertices: FloatPoint[], maxGap: number, simplifiedVertices?: FloatPoint[], workingVertices?: FloatPoint[]): FloatPoint[]
    • simplifyPath(sourceVertices: FloatPoint[], maxGap: number, simplifiedVertices?: FloatPoint[], workingVertices?: FloatPoint[]): FloatPoint[]