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
  • Add the standard events handler.

    Parameters

    Returns void

  • centerWindow(): void
  • Center the window on screen.

    Returns 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 a standard canvas inside canvasArea.

    Parameters

    • parentElement: HTMLElement

    Returns void

  • getCanvas(): null | HTMLCanvasElement
  • Get the canvas DOM element.

    Returns 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
  • Get the DOM element used as a container for HTML elements to display on top of the game.

    Returns null | HTMLDivElement

  • getElectron(): any
  • Get the electron module, if running as a electron renderer process.

    Returns any

  • getElectronRemote(): any
  • Helper to get the electron remote module, if running on Electron. Note that is not guaranteed to be supported in the future - avoid if possible.

    Returns any

  • getPIXIRenderer(): null | Renderer
  • Returns null | Renderer

  • getThreeRenderer(): null | WebGLRenderer
  • Get the Three.js renderer for the game - if any.

    Returns null | WebGLRenderer

  • getWindowInnerHeight(): number
  • Returns number

  • getWindowInnerWidth(): number
  • Returns number

  • getWindowTitle(): string
  • Returns string

  • isFullScreen(): boolean
  • Checks if the game is in full screen.

    Returns boolean

  • isWebGLSupported(): boolean
  • Check if the device supports WebGL.

    Returns boolean

    true if WebGL is supported

  • keepAspectRatio(enable: any): void
  • Set if the aspect ratio must be kept when the game canvas is resized to fill the page.

    Parameters

    • enable: any

    Returns void

  • openURL(url: string): void
  • Open the given URL in the system browser (or a new tab)

    Parameters

    • url: string

    Returns void

  • setFullScreen(enable: any): void
  • De/activate fullscreen for the game.

    Parameters

    • enable: any

    Returns void

  • setMargins(top: any, right: any, bottom: any, left: any): void
  • Change the margin that must be preserved around the game canvas.

    Parameters

    • top: any
    • right: any
    • bottom: any
    • left: any

    Returns void

  • setWindowSize(width: number, height: number): void
  • Update the window size, if possible.

    Parameters

    • width: number

      The new width, in pixels.

    • height: number

      The new height, in pixels.

    Returns void

  • setWindowTitle(title: any): void
  • Parameters

    • title: any

    Returns void

  • startGameLoop(fn: any): void
  • Parameters

    • fn: any

    Returns void

  • stopGame(): void
  • Close the game, if applicable

    Returns 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