Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a layer of a scene, used to display objects.

Hierarchy

Index

Methods

  • addEffect(effectData: EffectData): void
  • applyLayerInverseTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
  • Return an array containing the coordinates of the point passed as parameter in layer local coordinates (as opposed to the parent coordinates).

    All transformations (scale, rotation) are supported.

    This method doesn't handle 3D rotations.

    Parameters

    • x: number

      The X position of the point, in parent coordinates.

    • y: number

      The Y position of the point, in parent coordinates.

    • cameraId: number
    • result: FloatPoint

      Array that will be updated with the result

    Returns FloatPoint

  • applyLayerTransformation(x: number, y: number, cameraId: number, result: FloatPoint): FloatPoint
  • Return an array containing the coordinates of the point passed as parameter in parent coordinate coordinates (as opposed to the layer local coordinates).

    All transformations (scale, rotation) are supported.

    This method doesn't handle 3D rotations.

    Parameters

    • x: number

      The X position of the point, in layer coordinates.

    • y: number

      The Y position of the point, in layer coordinates.

    • cameraId: number
    • result: FloatPoint

      Array that will be updated with the result (x and y position of the point in parent coordinates).

    Returns FloatPoint

  • convertCoords(x: number, y: number, cameraId?: number, result: FloatPoint): FloatPoint
  • Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.

    This method handles 3D rotations.

    Parameters

    • x: number

      The x position, in canvas coordinates.

    • y: number

      The y position, in canvas coordinates.

    • cameraId: number = 0

      The camera number. Currently ignored.

    • result: FloatPoint

      The point instance that is used to return the result.

    Returns FloatPoint

  • convertInverseCoords(x: number, y: number, cameraId?: number, result: FloatPoint): FloatPoint
  • Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.

    This method doesn't handle 3D rotations.

    Parameters

    • x: number

      The x position, in container coordinates.

    • y: number

      The y position, in container coordinates.

    • cameraId: number = 0

      The camera number. Currently ignored.

    • result: FloatPoint

      The point instance that is used to return the result.

    Returns FloatPoint

  • enableEffect(name: string, enable: boolean): void
  • followBaseLayer(): void
  • get3DRendererObject(): null | Scene
  • getCameraHeight(cameraId?: number): number
  • Get the camera height (which can be different than the game resolution height if the camera is zoomed).

    Parameters

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns number

    The height of the camera

  • getCameraRotation(cameraId?: number): number
  • getCameraWidth(cameraId?: number): number
  • Get the camera width (which can be different than the game resolution width if the camera is zoomed).

    Parameters

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns number

    The width of the camera

  • getCameraX(cameraId?: number): number
  • getCameraY(cameraId?: number): number
  • getCameraZ(fov: null | number, cameraId?: number): number
  • Get the camera center Z position.

    Parameters

    • fov: null | number

      The field of view.

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns number

    The z position of the camera

  • getCameraZoom(cameraId?: number): number
  • getClearColor(): number[]
  • getDefaultZOrder(): number
  • getHeight(): number
  • getInitialCamera3DFarPlaneDistance(): number
  • getInitialCamera3DFieldOfView(): number
  • getInitialCamera3DNearPlaneDistance(): number
  • getInitialEffectsData(): EffectData[]
  • getName(): string
  • getRendererEffects(): Record<string, Filter>
  • getRendererObject(): Container<DisplayObject>
  • getTimeScale(): number
  • getWidth(): number
  • hasEffect(name: string): boolean
  • isEffectEnabled(name: string): boolean
  • isLightingLayer(): boolean
  • isVisible(): boolean
  • onGameResolutionResized(oldGameResolutionOriginX: number, oldGameResolutionOriginY: number): void
  • removeEffect(effectName: string): void
  • setCameraRotation(rotation: number, cameraId?: number): void
  • Set the rotation of the camera, expressed in degrees. The rotation is made around the camera center.

    Parameters

    • rotation: number

      The new rotation, in degrees.

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns void

  • setCameraX(x: number, cameraId?: number): void
  • setCameraY(y: number, cameraId?: number): void
  • setCameraZ(z: number, fov: null | number, cameraId?: number): void
  • Set the camera center Z position.

    Parameters

    • z: number

      The new y position.

    • fov: null | number

      The field of view.

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns void

  • setCameraZoom(newZoom: number, cameraId?: number): void
  • Set the zoom of a camera.

    Parameters

    • newZoom: number

      The new zoom. Must be superior to 0. 1 is the default zoom.

    • Optional cameraId: number

      The camera number. Currently ignored.

    Returns void

  • setClearColor(r: number, g: number, b: number): void
  • Set the clear color in format [r, g, b], with components in the range of 0 to 1.;

    Parameters

    • r: number

      Red color component in the range 0-255.

    • g: number

      Green color component in the range 0-255.

    • b: number

      Blue color component in the range 0-255.

    Returns void

  • setDefaultZOrder(defaultZOrder: number): void
  • setEffectBooleanParameter(name: string, parameterName: string, value: boolean): void
  • setEffectDoubleParameter(name: string, parameterName: string, value: number): void
  • setEffectStringParameter(name: string, parameterName: string, value: string): void
  • setFollowBaseLayerCamera(follow: boolean): void
  • setTimeScale(timeScale: number): void
  • show(enable: boolean): void

Constructors

Generated using TypeDoc