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

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.

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
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
ObjectConfiguration: { content: any }

Type declaration

  • content: any
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
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; 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 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

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.

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?

TextRuntimeObjectRenderer: TextRuntimeObjectPixiRenderer
TileMapRuntimeObjectRenderer: TileMapRuntimeObjectPixiRenderer
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
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.

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]

  • 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