PIXI.CanvasTinter

new CanvasTinter()

Utility methods for Sprite/Texture tinting.

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

Methods

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

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

Name

Type

Description

sprite

PIXI.Sprite

the sprite to tint

color

Number

the color to use to tint the sprite with

HTMLCanvasElement-

The tinted canvas

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

<static> tintPerPixel(texture, color, canvas)

Tint a texture pixel per pixel.

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 73

<static> tintWithMultiply(texture, color, canvas)

Tint a texture using the "multiply" operation.

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