Options
All
  • Public
  • Public/Protected
  • All
Menu

Creates a Canvas element of the given size to be used as a target for rendering to.

memberof

PIXI.utils

Hierarchy

  • CanvasRenderTarget

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • new CanvasRenderTarget(width: number, height: number, resolution?: number): CanvasRenderTarget
  • Parameters

    • width: number

      the width for the newly created canvas

    • height: number

      the height for the newly created canvas

    • Optional resolution: number

    Returns CanvasRenderTarget

Properties

canvas

canvas: HTMLCanvasElement

The Canvas object that belongs to this CanvasRenderTarget.

context

context: CanvasRenderingContext2D

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

resolution

resolution: number

The resolution / device pixel ratio of the canvas

default

1

Accessors

height

  • get height(): number
  • set height(val: number): void
  • The height of the canvas buffer in pixels.

    member

    {number}

    Returns number

  • The height of the canvas buffer in pixels.

    Parameters

    • val: number

    Returns void

width

  • get width(): number
  • set width(val: number): void
  • The width of the canvas buffer in pixels.

    member

    {number}

    Returns number

  • The width of the canvas buffer in pixels.

    Parameters

    • val: number

    Returns void

Methods

Private clear

  • clear(): void
  • Clears the canvas that was created by the CanvasRenderTarget class.

    Returns void

destroy

  • destroy(): void
  • Destroys this canvas.

    Returns void

resize

  • resize(width: number, height: number): void
  • Resizes the canvas to the specified width and height.

    Parameters

    • width: number

      the new width of the canvas

    • height: number

      the new height of the canvas

    Returns void

Generated using TypeDoc