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 } }

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

    • align: "left" | "center" | "right"

      Alignment of the text: "left", "center" or "right"

    • color: string

      The color of the text

    • fontFamily: string

      The font of the text

    • fontSize: number

      The size of the text

    • opacity: number

      The opacity of the BBText

    • text: string

      Content of the text

    • visible: boolean

      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 } }

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

    • align: "left" | "center" | "right"

      Alignment of the text.

    • bitmapFontResourceName: string

      The name of the resource containing the bitmap font for the text.

    • opacity: float

      The opacity of the text.

    • scale: float

      The scale of the text.

    • text: string

      Content of the text.

    • textureAtlasResourceName: string

      The name of the resource containing the atlas image file for the text.

    • tint: string

      The tint of the text.

    • wordWrap: boolean

      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
    • 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 }

    The base parameters of light object.

    • color: string

      A string representing color in hexadecimal format.

    • debugMode: boolean

      true if the light objects shows debug graphics, false otherwise.

    • radius: number

      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

    The bottom margin

  • height: number

    The object height

  • leftMargin: number

    The left margin

  • rightMargin: number

    The right margin

  • texture: string

    The name of the resource containing the texture to use

  • tiled: boolean

    Are the central part and borders tiled?

  • topMargin: number

    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

    Destroy the object when there is no particles?

  • emitterAngleA: number
    deprecated

    Data not used

  • emitterAngleB: number

    Cone spray angle (degrees)

  • emitterForceMax: number
  • emitterForceMin: number
  • flow: number
  • jumpForwardInTimeOnCreation: number
  • maxParticleNb: number
  • particleAlpha1: number
  • particleAlpha2: number
  • particleAngle1: number

    Particle min rotation speed (degrees/second)

  • particleAngle2: number

    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 }

Represents a color in RGB Format

Type declaration

  • b: integer

    The Blue component of the color, from 0 to 255.

  • g: integer

    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; 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 to be done through a iframe. This is usually discouraged as the user can't verify that the authentication window is a genuine one. It's only to be used in trusted contexts.

  • Optional electronRemoteRequirePath?: string

    The path to require @electron/remote module. This is only useful in a preview, where this can't be required from @electron/remote directly as previews don't have any node_modules. On the contrary, a game packaged with Electron as a standalone app has its node_modules. This can be removed once there are no more dependencies on @electron/remote in the game engine and extensions.

  • Optional environment?: "dev"

    If set, the game should use the specified environment for making calls to GDevelop APIs ("dev" = development APIs).

  • Optional forceFullscreen?: boolean

    if true, force fullscreen.

  • Optional gdevelopResourceToken?: string

    the token to use by the game engine when requiring any resource stored on GDevelop Cloud buckets. Note that this is only useful during previews.

  • Optional injectExternalLayout?: string

    The name of the external layout to create in the scene at position 0;0.

  • Optional isPreview?: boolean

    if true, game is run as a preview launched from an editor.

  • Optional nativeMobileApp?: boolean

    if true, preview is launched from GDevelop native mobile app.

  • Optional projectDataOnlyExport?: boolean

    if true, export is a partial preview without events.

  • Optional scriptFiles?: RuntimeGameOptionsScriptFile[]

    Script files, used for hot-reloading.

  • Optional websocketDebuggerServerAddress?: string

    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 }

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 }

Initial properties for a for gdjs.ShapePainterRuntimeObject.

Type declaration

  • absoluteCoordinates: boolean

    Use absolute coordinates?

  • antialiasing: Antialiasing

    The type of anti-aliasing to apply at rendering.

  • clearBetweenFrames: boolean

    Clear the previous render before the next draw?

  • fillColor: RGBColor

    The color (in RGB format) of the inner part of the painted shape

  • fillOpacity: float

    The opacity of the inner part of the painted shape, from 0 to 255

  • outlineColor: RGBColor

    The color (in RGB format) of the outline of the painted shape

  • outlineOpacity: float

    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
    • 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

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 }

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 }

Represents the center point in a frame.

Type declaration

  • automatic: boolean

    Is the center automatically computed?

  • name: string

    Name of the point.

  • x: float

    X position of the point.

  • y: float

    Y position of the point.

SpriteCustomPointData: { name: string; x: float; y: float }

Represents a custom point in a frame.

Type declaration

  • name: string

    Name of the point.

  • x: float

    X position of the point.

  • y: float

    Y position of the point.

SpriteDirectionData: { looping: boolean; sprites: SpriteFrameData[]; timeBetweenFrames: float }

Represents the data of a gdjs.SpriteAnimationDirection.

Type declaration

  • looping: boolean

    Is the animation looping?

  • sprites: SpriteFrameData[]

    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[] }

Type declaration

  • centerPoint: SpriteCenterPointData

    The center of the frame.

  • customCollisionMask: SpritePoint[][]

    The collision mask if it is custom.

  • hasCustomCollisionMask: boolean

    Is The collision mask custom?

  • image: string

    The resource name of the image used in this frame.

  • originPoint: SpriteCustomPointData

    The origin point.

  • points: SpriteCustomPointData[]

    The points of the frame.

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 }

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
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?

    • characterSize: number

      The size of the characters

    • color: string

      The text color in an RGB representation

    • font: string

      The font name

    • isOutlineEnabled: boolean
    • isShadowEnabled: boolean
    • italic: boolean

      Is Italic?

    • outlineColor: string

      The outline color in an RGB representation

    • outlineThickness: float
    • shadowAngle: float
    • shadowBlurRadius: float
    • shadowColor: string

      The shadow color in an RGB representation

    • shadowDistance: float
    • shadowOpacity: float
    • text: string

      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 }

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

    • loop: boolean

      Does the video loops itself?

    • opacity: number

      The opacity of the video

    • videoResource: string

      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 = ''

Base64 encoded logo of GDevelop for the splash screen.

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; getDisconnectedPlayers: () => number[]; getMessageData: (messageName: string) => any; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; 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; hasMessageBeenReceived: (userMessageName: string) => boolean; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendDataTo: (peerId: string, messageName: string, data: Object) => void; sendEndGameMessage: () => void; sendMessage: (userMessageName: string, userMessageData: string) => 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

  • getDisconnectedPlayers: () => number[]
      • (): number[]
      • Returns number[]

  • getMessageData: (messageName: string) => any
      • (messageName: string): any
      • Parameters

        • messageName: string

        Returns any

  • getNumberOfConnectedPlayers: () => number
      • (): number
      • Returns number

  • getPlayerPing: (playerNumber: number) => number
      • (playerNumber: number): number
      • Parameters

        • playerNumber: number

        Returns number

  • 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

  • hasMessageBeenReceived: (userMessageName: string) => boolean
      • (userMessageName: string): boolean
      • Parameters

        • userMessageName: string

        Returns boolean

  • 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
  • sendDataTo: (peerId: string, messageName: string, data: Object) => void
      • (peerId: 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

        • peerId: string
        • messageName: string
        • data: Object

        Returns void

  • sendEndGameMessage: () => void
      • (): void
      • Returns void

  • sendMessage: (userMessageName: string, userMessageData: string) => void
      • (userMessageName: string, userMessageData: string): void
      • Parameters

        • userMessageName: string
        • userMessageData: string

        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
  • 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 to be loaded before the game startup, are loaded. If a library fails loading, this will be rejected.

  • 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]
  • 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]
  • 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; getDisconnectedPlayers: () => number[]; getMessageData: (messageName: string) => any; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; 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; hasMessageBeenReceived: (userMessageName: string) => boolean; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendDataTo: (peerId: string, messageName: string, data: Object) => void; sendEndGameMessage: () => void; sendMessage: (userMessageName: string, userMessageData: string) => 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; getDisconnectedPlayers: () => number[]; getMessageData: (messageName: string) => any; getNumberOfConnectedPlayers: () => number; getPlayerPing: (playerNumber: number) => number; 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; hasMessageBeenReceived: (userMessageName: string) => boolean; hasPlayerLeft: (playerNumber: number) => boolean; isPlayerConnected: (playerNumber: number) => boolean; resendClearOrCancelAcknowledgedMessages: (runtimeScene: RuntimeScene) => void; sendDataTo: (peerId: string, messageName: string, data: Object) => void; sendEndGameMessage: () => void; sendMessage: (userMessageName: string, userMessageData: string) => 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

    • getDisconnectedPlayers: () => number[]
        • (): number[]
        • Returns number[]

    • getMessageData: (messageName: string) => any
        • (messageName: string): any
        • Parameters

          • messageName: string

          Returns any

    • getNumberOfConnectedPlayers: () => number
        • (): number
        • Returns number

    • getPlayerPing: (playerNumber: number) => number
        • (playerNumber: number): number
        • Parameters

          • playerNumber: number

          Returns number

    • 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

    • hasMessageBeenReceived: (userMessageName: string) => boolean
        • (userMessageName: string): boolean
        • Parameters

          • userMessageName: string

          Returns boolean

    • 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
    • sendDataTo: (peerId: string, messageName: string, data: Object) => void
        • (peerId: 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

          • peerId: string
          • messageName: string
          • data: Object

          Returns void

    • sendEndGameMessage: () => void
        • (): void
        • Returns void

    • sendMessage: (userMessageName: string, userMessageData: string) => void
        • (userMessageName: string, userMessageData: string): void
        • Parameters

          • userMessageName: string
          • userMessageData: string

          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
  • Get a random integer between 0 and max.

    Parameters

    • max: number

      The maximum value (inclusive).

    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
  • 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
  • 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
  • Get a random number between min and max in steps

    Parameters

    • min: number

      The minimum value (inclusive).

    • max: number

      The maximum value (inclusive).

    • step: number

      The interval between each value.

    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
  • Register a runtime behavior (class extending gdjs.RuntimeBehavior) that can be used by a gdjs.RuntimeObject.

    The type of the behavior must be complete, with the namespace of the extension. For example, if you are providing a Draggable behavior in the DraggableBehavior extension, the full name of the type of the behavior is "DraggableBehavior::Draggable".

    Parameters

    • behaviorTypeName: string

      The name of the type of the behavior.

    • Ctor: typeof RuntimeBehavior

      The constructor of the Object.

    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
  • 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 of the type of the object is "TextObject::Text".

    Parameters

    • objectTypeName: string

      The name of the type of the Object.

    • Ctor: typeof RuntimeObject

      The constructor of the Object.

    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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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
  • 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]
  • 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
  • Convert a RGB object to a Hex string.

    No "#" or "0x" are added.

    Parameters

    • r: number

      Red

    • g: number

      Green

    • b: number

      Blue

    Returns string

  • rgbToHexNumber(r: number, g: number, b: number): number
  • Convert a RGB object to a Hex number.

    Parameters

    • r: number

      Red

    • g: number

      Green

    • b: number

      Blue

    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[]
  • 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
  • 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
  • Convert an angle in radians to degrees.

    Parameters

    • angleInRadians: number

      The angle in radians.

    Returns number

  • toRad(angleInDegrees: number): number
  • Convert an angle in degrees to radians.

    Parameters

    • angleInDegrees: number

      The angle in degrees.

    Returns number

  • registerGlobalCallbacks(): void
  • Keep this function until we're sure now client is using it anymore.

    deprecated

    Returns void

Generated using TypeDoc