Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • RuntimeGamePixiRenderer

Index

Methods

  • bindStandardEvents(manager: InputManager, window: Window, document: Document): void
  • centerWindow(): void
  • convertCanvasToDomElementContainerCoords(canvasCoords: FloatPoint, result: FloatPoint): FloatPoint
  • Convert a point from the canvas coordinates to the dom element container coordinates.

    Parameters

    • canvasCoords: FloatPoint

      The point in the canvas coordinates.

    • result: FloatPoint

      The point to return.

    Returns FloatPoint

    The point in the dom element container coordinates.

  • createStandardCanvas(parentElement: HTMLElement): void
  • Create the canvas on which the game will be rendered, inside the specified DOM element, and setup the rendering of the game. If you want to use your own canvas, use initializeForCanvas instead.

    Parameters

    • parentElement: HTMLElement

      The parent element to which the canvas will be added.

    Returns void

  • dispose(removeCanvas?: boolean): void
  • Dispose the renderers (PixiJS and/or Three.js) as well as DOM elements used for the game (the canvas, if specified, and the additional DOM container created on top of it to allow display HTML elements, for example for text inputs).

    Parameters

    • Optional removeCanvas: boolean

      If true, the canvas will be removed from the DOM.

    Returns void

  • getCanvas(): null | HTMLCanvasElement
  • getCanvasToDomElementContainerHeightScale(): number
  • Return the scale factor between the renderer height and the actual canvas height, which is also the height of the container for DOM elements to be superimposed on top of it.

    Useful to scale font sizes of DOM elements so that they follow the size of the game.

    Returns number

  • getDomElementContainer(): null | HTMLDivElement
  • getElectron(): any
  • getElectronRemote(): any
  • getPIXIRenderer(): null | Renderer
  • getThreeRenderer(): null | WebGLRenderer
  • getWindowInnerHeight(): number
  • getWindowInnerWidth(): number
  • getWindowTitle(): string
  • initializeForCanvas(gameCanvas: HTMLCanvasElement): void
  • isFullScreen(): boolean
  • isWebGLSupported(): boolean
  • keepAspectRatio(enable: any): void
  • openURL(url: string): void
  • setFullScreen(enable: any): void
  • setMargins(top: any, right: any, bottom: any, left: any): void
  • setWindowSize(width: number, height: number): void
  • setWindowTitle(title: any): void
  • startGameLoop(fn: any): void
  • stopGame(): void
  • stopGameLoop(): void
  • updateRendererSize(): void
  • Update the game renderer size according to the "game resolution". Called when game resolution changes.

    Note that if the canvas is fullscreen, it won't be resized, but when going back to non fullscreen mode, the requested size will be used.

    Returns void

Constructors

Generated using TypeDoc