PIXI. CanvasPool

new CanvasPool()

The CanvasPool is a global static object that allows Pixi and Phaser to pool canvas DOM elements.

Source - pixi/utils/CanvasPool.js, line 7

Members

<static> pool :Array

The pool into which the canvas dom elements are placed.

Source - pixi/utils/CanvasPool.js, line 173

Methods

<static> create(parent, width, height) → {HTMLCanvasElement}

Creates a new Canvas DOM element, or pulls one from the pool if free.

Parameters:
Name Type Description
parent

The parent of the canvas element.

width Number

The width of the canvas element.

height Number

The height of the canvas element.

Returns:
HTMLCanvasElement -

The canvas element.

Source - pixi/utils/CanvasPool.js, line 15

<static> getFirst() → {Number}

Gets the first free canvas index from the pool.

Returns:
Number -
Source - pixi/utils/CanvasPool.js, line 58

<static> getFree() → {Number}

Gets the total number of free canvas elements in the pool.

Returns:
Number -

The number of free (un-parented) canvas elements in the pool.

Source - pixi/utils/CanvasPool.js, line 147

<static> getTotal() → {Number}

Gets the total number of used canvas elements in the pool.

Returns:
Number -

The number of in-use (parented) canvas elements in the pool.

Source - pixi/utils/CanvasPool.js, line 123

<static> remove(parent)

Removes the parent from a canvas element from the pool, freeing it up for re-use.

Parameters:
Name Type Description
parent

The parent of the canvas element.

Source - pixi/utils/CanvasPool.js, line 81

<static> removeByCanvas(canvas)

Removes the parent from a canvas element from the pool, freeing it up for re-use.

Parameters:
Name Type Description
canvas HTMLCanvasElement

The canvas element to remove

Source - pixi/utils/CanvasPool.js, line 102
Phaser Copyright © 2012-2016 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.2 on Fri Apr 22 2016 15:11:58 GMT+0100 (GMT Daylight Time) using the DocStrap template.