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 177

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 151

<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 127

<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 104
Phaser Copyright © 2012-2016 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.3 on Mon Jul 11 2016 10:10:53 GMT+0100 (GMT Daylight Time) using the DocStrap template.