#

API Docs for: 1.4.0
Show: Inherited Protected Private Deprecated

# CanvasRenderer Class

Defined in: `src/pixi/renderers/canvas/CanvasRenderer.js:5`
Module: PIXI

the CanvasRenderer draws the stage and all its content onto a 2d canvas. This renderer should be used for browsers that do not support webGL. Dont forget to add the view to your DOM or you will not see anything :)

## Constructor

### `CanvasRenderer`

(

- `width=0`
- `height=0`
- `view`
- `transparent=false`

)

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:5`

#### Parameters:

- `width=0` Number

  the width of the canvas view

- `height=0` Number

  the height of the canvas view

- `view` Canvas

  the canvas to use as a view, optional

- `transparent=false` Boolean

  the transparency of the render view, default false

- Index
- Methods
- Properties

## Item Index

### Methods

- render
- renderDisplayObject
- renderStrip
- renderStripFlat
- resize

### Properties

- context
- height
- view
- width

## Methods

### `render`

(

- `stage`

)

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:111`

Renders the stage to its canvas view

#### Parameters:

- `stage` Stage

  the Stage element to be rendered

### `renderDisplayObject`

(

- `displayObject`

)
private

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:172`

Renders a display object

#### Parameters:

- `displayObject` DisplayObject

  The displayObject to render

### `renderStrip`

(

- `strip`

)
private

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:223`

Renders a strip

#### Parameters:

- `strip` Strip

  The Strip to render

### `renderStripFlat`

(

- `strip`

)
private

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:189`

Renders a flat strip

#### Parameters:

- `strip` Strip

  The Strip to render

### `resize`

(

- `width`
- `height`

)

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:156`

resizes the canvas view to the specified width and height

#### Parameters:

- `width` Number

  the new width of the canvas view

- `height` Number

  the new height of the canvas view

## Properties

### `context`

Canvas 2d Context

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:71`

The canvas context that the everything is drawn to

### `height`

Number

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:54`

The height of the canvas view

Default: 600

### `view`

Canvas

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:63`

The canvas element that the everything is drawn to

### `width`

Number

Defined in `src/pixi/renderers/canvas/CanvasRenderer.js:45`

The width of the canvas view

Default: 800