Represents a layer of a custom object. It doesn't allow to move any camera because it doesn't make sense inside an object.

Hierarchy (view full)

Constructors

Methods

  • 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.

    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

  • 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.

    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

  • Convert a point from the canvas coordinates (for example, the mouse position) to the container coordinates.

    Parameters

    • x: number

      The x position, in canvas coordinates.

    • y: number

      The y position, in canvas coordinates.

    • cameraId: number

      The camera number. Currently ignored.

    • result: FloatPoint

      The point instance that is used to return the result.

    Returns FloatPoint

  • Convert a point from the container coordinates (for example, an object position) to the canvas coordinates.

    Parameters

    • x: number

      The x position, in container coordinates.

    • y: number

      The y position, in container coordinates.

    • cameraId: number

      The camera number. Currently ignored.

    • result: FloatPoint

      The point instance that is used to return the result.

    Returns FloatPoint

  • 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

  • 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

  • Set the default Z order to be attributed to objects created on this layer.

    Parameters

    • defaultZOrder: number

      The Z order to use when creating a new object from events.

    Returns void

  • Change an effect property value (for properties that are booleans).

    Parameters

    • name: string

      The name of the effect to update.

    • parameterName: string

      The name of the property to update.

    • value: boolean

      The new value (boolean).

    Returns void

  • Change an effect property value (for properties that are numbers).

    Parameters

    • name: string

      The name of the effect to update.

    • parameterName: string

      The name of the property to update.

    • value: number

      The new value (number).

    Returns void

  • Change an effect property value (for properties that are strings).

    Parameters

    • name: string

      The name of the effect to update.

    • parameterName: string

      The name of the property to update.

    • value: string

      The new value (string).

    Returns void

  • Set the time scale for the objects on the layer: time will be slower if time scale is < 1, faster if > 1.

    Parameters

    • timeScale: number

      The new time scale (must be positive).

    Returns void