PIXI. CanvasTinter

new CanvasTinter()

Utility methods for Sprite/Texture tinting.

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 5

Members

<static> canHandleAlpha :Boolean

If the browser isn't capable of handling tinting with alpha this will be false. This property is only applicable if using tintWithPerPixel.

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 146

<static> canUseMultiply :Boolean

Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 156

Methods

<static> checkInverseAlpha()

Checks if the browser correctly supports putImageData alpha channels.

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 113

<static> getTintedTexture(sprite, color) → {HTMLCanvasElement}

Basically this method just needs a sprite and a color and tints the sprite with the given color.

Parameters:
Name Type Description
sprite PIXI.Sprite

the sprite to tint

color Number

the color to use to tint the sprite with

Returns:
HTMLCanvasElement -

The tinted canvas

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 13

<static> tintMethod()

The tinting method that will be used.

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 165

<static> tintPerPixel(texture, color, canvas)

Tint a texture pixel per pixel.

Parameters:
Name Type Description
texture PIXI.Texture

the texture to tint

color Number

the color to use to tint the sprite with

canvas HTMLCanvasElement

the current canvas

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 65

<static> tintWithMultiply(texture, color, canvas)

Tint a texture using the "multiply" operation.

Parameters:
Name Type Description
texture PIXI.Texture

the texture to tint

color Number

the color to use to tint the sprite with

canvas HTMLCanvasElement

the current canvas

Source - pixi/renderers/canvas/utils/CanvasTinter.js, line 31
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.