Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a game being played.

Hierarchy

  • RuntimeGame

Index

Constructors

  • Parameters

    • data: ProjectData

      The object (usually stored in data.json) containing the full project data

    • Optional options: RuntimeGameOptions

    Returns RuntimeGame

Methods

  • enableMetrics(enable: boolean): void
  • Set if the session should be registered.

    Parameters

    • enable: boolean

    Returns void

  • getAdaptGameResolutionAtRuntime(): boolean
  • Returns if the game resolution should be automatically adapted when the game window or screen size change. This will only be the case if the game resolution resize mode is configured to adapt the width or the height of the game.

    Returns boolean

    true if the game resolution is automatically changed according to the window/screen size.

  • Return the additional options passed to the RuntimeGame when created.

    Returns null | RuntimeGameOptions

    The additional options, if any.

  • getAntialiasingMode(): "none" | "MSAA"
  • Return the antialiasing mode used by the game ("none" or "MSAA").

    Returns "none" | "MSAA"

  • Get the gdjs.BitmapFontManager of the RuntimeGame.

    Returns PixiBitmapFontManager

    The bitmap font manager.

  • getEffectsManager(): PixiEffectsManager
  • Get the effects manager of the game, which allows to manage effects on runtime objects or runtime layers.

    Returns PixiEffectsManager

    The effects manager for the game

  • getEventsBasedObjectData(type: string): null | EventsBasedObjectData
  • Parameters

    • type: string

    Returns null | EventsBasedObjectData

  • getExtensionProperty(extensionName: string, propertyName: string): null | string
  • Gets an extension property from the project data.

    Parameters

    • extensionName: string

      The extension name.

    • propertyName: string

      The property name.

    Returns null | string

    The property value.

  • getExternalLayoutData(name: string): null | ExternalLayoutData
  • Get the data associated to an external layout.

    Parameters

    • name: string

      The name of the external layout.

    Returns null | ExternalLayoutData

    The data associated to the external layout or null if not found.

  • getGameData(): ProjectData
  • Get the object containing the game data

    Returns ProjectData

    The object associated to the game.

  • getGameResolutionHeight(): number
  • Get the game resolution (the size at which the game is played and rendered) height.

    Returns number

    The game resolution height, in pixels.

  • getGameResolutionResizeMode(): string
  • Returns if the width or the height of the game resolution should be changed to fit the game window - or if the game resolution should not be updated automatically (empty string).

    Returns string

    Either "" (don't change game resolution), "adaptWidth" or "adaptHeight".

  • getGameResolutionWidth(): number
  • Get the game resolution (the size at which the game is played and rendered) width.

    Returns number

    The game resolution width, in pixels.

  • Get the gdjs.ImageManager of the RuntimeGame.

    Returns PixiImageManager

    The image manager.

  • getInitialObjectsData(): ObjectData[]
  • Get the data representing all the global objects of the game.

    Returns ObjectData[]

    The data associated to the global objects.

  • Get the input manager of the game, storing mouse, keyboard and touches states.

    Returns InputManager

    The input manager owned by the game

  • Get the JSON manager of the game, used to load JSON from game resources.

    Returns JsonManager

    The json manager for the game

  • getMinimalFramerate(): number
  • Return the minimal fps that must be guaranteed by the game (otherwise, game is slowed down).

    Returns number

  • Get the 3D model manager of the game, used to load 3D model from game resources.

    Returns Model3DManager

    The 3D model manager for the game

  • getOriginalHeight(): number
  • Get the original height of the game, as set on the startup of the game.

    This is guaranteed to never change, even if the size of the game is changed afterwards.

    Returns number

  • getOriginalWidth(): number
  • Get the original width of the game, as set on the startup of the game.

    This is guaranteed to never change, even if the size of the game is changed afterwards.

    Returns number

  • getPixelsRounding(): boolean
  • Return if the game is rounding pixels when rendering.

    Returns boolean

  • getPlayerId(): null | string
  • Returns null | string

  • getScaleMode(): "linear" | "nearest"
  • Return the scale mode of the game ("linear" or "nearest").

    Returns "linear" | "nearest"

  • getSceneData(sceneName?: string): null | LayoutData
  • Get the data associated to a scene.

    Parameters

    • Optional sceneName: string

      The name of the scene. If not defined, the first scene will be returned.

    Returns null | LayoutData

    The data associated to the scene.

  • getSessionId(): null | string
  • Returns null | string

  • Get the gdjs.SoundManager of the RuntimeGame.

    Returns HowlerSoundManager

    The sound manager.

  • hasJustResumed(): boolean
  • Returns boolean

    true during the first frame the game is back from being hidden. This has nothing to do with _paused.

  • hasScene(sceneName?: string): boolean
  • Check if a scene exists

    Parameters

    • Optional sceneName: string

      The name of the scene to search.

    Returns boolean

    true if the scene exists. If sceneName is undefined, true if the game has a scene.

  • isAntialisingEnabledOnMobile(): boolean
  • Return true if antialising is enabled on mobiles.

    Returns boolean

  • isPreview(): boolean
  • Check if the game is running as a preview, launched from an editor.

    Returns boolean

    true if the current game is a preview.

  • isUsingGDevelopDevelopmentEnvironment(): boolean
  • Check if the game should call GDevelop development APIs or not.

    Unless you are contributing to GDevelop, avoid using this.

    Returns boolean

  • loadAllAssets(callback: () => void, progressCallback?: (float: any) => void): void
  • Load all assets, displaying progress in renderer.

    Parameters

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

    • Optional progressCallback: (float: any) => void
        • (float: any): void
        • Parameters

          • float: any

          Returns void

    Returns void

  • onWindowInnerSizeChanged(): void
  • Called by the game renderer when the window containing the game has changed size (this can result from a resize of the window, but also other factors like a device orientation change on mobile).

    Returns void

  • pause(enable: boolean): void
  • Set or unset the game as paused. When paused, the game won't step and will be freezed. Useful for debugging.

    Parameters

    • enable: boolean

      true to pause the game, false to unpause

    Returns void

  • resolveEmbeddedResource(mainResourceName: string, embeddedResourceName: string): string
  • Resolves the name of an embedded resource.

    Parameters

    • mainResourceName: string

      The name of the resource containing the embedded resource.

    • embeddedResourceName: string

      The name of the embedded resource.

    Returns string

    The resource name.

  • setAdaptGameResolutionAtRuntime(enable: boolean): void
  • Set if the game resolution should be automatically adapted when the game window or screen size change. This will only be the case if the game resolution resize mode is configured to adapt the width or the height of the game.

    Parameters

    • enable: boolean

      true to change the game resolution according to the window/screen size.

    Returns void

  • setGameResolutionResizeMode(resizeMode: string): void
  • Set if the width or the height of the game resolution should be changed to fit the game window - or if the game resolution should not be updated automatically.

    Parameters

    • resizeMode: string

      Either "" (don't change game resolution), "adaptWidth" or "adaptHeight".

    Returns void

  • setGameResolutionSize(width: number, height: number): void
  • Change the game resolution.

    Parameters

    • width: number

      The new width

    • height: number

      The new height

    Returns void

  • setProjectData(projectData: ProjectData): void
  • Update the project data. Useful for hot-reloading, should not be used otherwise.

    Parameters

    • projectData: ProjectData

      The object (usually stored in data.json) containing the full project data

    Returns void

  • startCurrentSceneProfiler(onProfilerStopped: (oldProfiler: Profiler) => void): boolean
  • Start a profiler for the currently running scene.

    Parameters

    • onProfilerStopped: (oldProfiler: Profiler) => void

      Function to be called when the profiler is stopped. Will be passed the profiler as argument.

    Returns boolean

  • startGameLoop(): void
  • Start the game loop, to be called once assets are loaded.

    Returns void

  • stopCurrentSceneProfiler(): void
  • Stop the profiler for the currently running scene.

    Returns void

  • wasFirstSceneLoaded(): boolean
  • Return true if a scene was loaded, false otherwise (i.e: game not yet started).

    Returns boolean

Properties

inventories: {}

Type declaration

shopifyClients: {}

Type declaration

  • [name: string]: any

Generated using TypeDoc