#

API Docs for: 2.0.0
Show: Inherited Protected Private Deprecated

# CanvasMaskManager Class

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

A set of functions used to handle masking

- Index
- Methods
- Properties

## Item Index

### Methods

- CanvasBuffer
- clear
- popMask
- pushMask
- resize

### Properties

- canvas
- context
- height
- width

## Methods

### `CanvasBuffer`

(

- `width`
- `height`

)

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

Creates a Canvas element of the given size.

#### Parameters:

- `width` Number

  the width for the newly created canvas

- `height` Number

  the height for the newly created canvas

### `clear`

() private

Defined in `src/pixi/renderers/canvas/utils/CanvasBuffer.js:52`

Clears the canvas that was created by the CanvasBuffer class.

### `popMask`

(

- `renderSession`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasMaskManager.js:46`

Restores the current drawing context to the state it was before the mask was applied.

#### Parameters:

- `renderSession` Object

  The renderSession whose context will be used for this mask manager.

### `pushMask`

(

- `maskData`
- `renderSession`

)

Defined in `src/pixi/renderers/canvas/utils/CanvasMaskManager.js:14`

This method adds it to the current stack of masks.

#### Parameters:

- `maskData` Object

  the maskData that will be pushed

- `renderSession` Object

  The renderSession whose context will be used for this mask manager.

### `resize`

(

- `width`
- `height`

)

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

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

## Properties

### `canvas`

HTMLCanvasElement

Defined in `src/pixi/renderers/canvas/utils/CanvasBuffer.js:30`

The Canvas object that belongs to this CanvasBuffer.

### `context`

CanvasRenderingContext2D

Defined in `src/pixi/renderers/canvas/utils/CanvasBuffer.js:38`

A CanvasRenderingContext2D object representing a two-dimensional rendering context.

### `height`

Number

Defined in `src/pixi/renderers/canvas/utils/CanvasBuffer.js:22`

The height of the Canvas in pixels.

### `width`

Number

Defined in `src/pixi/renderers/canvas/utils/CanvasBuffer.js:14`

The width of the Canvas in pixels.