#

API Docs for: 1.4.3
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:134`

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:208`

Renders a display object

#### Parameters:

- `displayObject` DisplayObject

  The displayObject to render

### `renderStrip`

(

- `strip`

)
private

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

Renders a strip

#### Parameters:

- `strip` Strip

  The Strip to render

### `renderStripFlat`

(

- `strip`

)
private

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

Renders a flat strip

#### Parameters:

- `strip` Strip

  The Strip to render

### `resize`

(

- `width`
- `height`

)

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

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:97`

The canvas context that the everything is drawn to

### `height`

Number

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

The height of the canvas view

Default: 600

### `view`

Canvas

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

The canvas element that the everything is drawn to

### `width`

Number

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

The width of the canvas view

Default: 800