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

Constructors

Properties

vectorForProjections: null | Vector3 = null
zeroZOrderForPixi: number = ...

Pixi doesn't sort children with zIndex == 0.

Methods

  • Add a child to the pixi container associated to the layer. All objects which are on this layer must be children of this container.

    Parameters

    • pixiChild: any

      The child (PIXI object) to be added.

    • zOrder: number

      The z order of the associated object.

    Returns void

  • Change the z order of a child associated to an object.

    Parameters

    • pixiChild: any

      The child (PIXI object) to be modified.

    • newZOrder: number

      The z order of the associated object.

    Returns void

  • Remove a child from the internal pixi container. Should be called when an object is deleted or removed from the layer.

    Parameters

    • child: any

      The child (PIXI object) to be removed.

    Returns void

  • Render the layer of the PixiJS RenderTexture, so that it can be then displayed with a blend mode (for a lighting layer) or consumed by Three.js (for 2D+3D layers).

    Parameters

    • pixiRenderer: Renderer

    Returns void

  • Set the maximum "drawing distance", in pixels, of the 2D when in the 3D world. This corresponds to the "height" of the 2D plane. Used when the 3D camera is tilted on the X or Y axis (instead of looking down the Z axis, as it's done by default for 2D games). This is useful to avoid the 2D plane being too big when the camera is tilted.

    Parameters

    • h: number

    Returns void

  • Enable or disable the drawing of an outline of the 2D rendering plane. Useful to visually see where the 2D rendering is done in the 3D world.

    Parameters

    • enable: boolean

    Returns void

  • Set the texture of the 2D plane in the 3D world to be the same WebGL texture as the PixiJS RenderTexture - so that the 2D rendering can be shown in the 3D world.

    Parameters

    • threeRenderer: WebGLRenderer
    • pixiRenderer: Renderer

    Returns void