Class: CanvasTinter

PIXI. CanvasTinter

new CanvasTinter()

Utility methods for Sprite/Texture tinting.

Source:
src/pixi/renderers/canvas/utils/CanvasTinter.js line 11

Methods

getTintedTexture(sprite, color)

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

Parameters:
Name Type Description
sprite Sprite

the sprite to tint

color Number

the color to use to tint the sprite with

Source:
src/pixi/renderers/canvas/utils/CanvasTinter.js line 13
Returns:

The tinted canvas

Type
HTMLCanvasElement

tintPerPixel(texture, color, canvas)

Tint a texture pixel per pixel.

Parameters:
Name Type Description
texture Texture

the texture to tint

color Number

the color to use to tint the sprite with

canvas HTMLCanvasElement

the current canvas

Source:
src/pixi/renderers/canvas/utils/CanvasTinter.js line 72

tintWithMultiply(texture, color, canvas)

Tint a texture using the "multiply" operation.

Parameters:
Name Type Description
texture Texture

the texture to tint

color Number

the color to use to tint the sprite with

canvas HTMLCanvasElement

the current canvas

Source:
src/pixi/renderers/canvas/utils/CanvasTinter.js line 31

phaser-ce@2.20.0 is on GitHub and NPM

Documentation generated by JSDoc 3.6.7 on 2022-12-10 using Tomorrow.