new CanvasTinter()
Utility methods for Sprite/Texture tinting.
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 spriteSprite the sprite to tint
colorNumber the color to use to tint the sprite with
Returns:
The tinted canvas
- Type
- HTMLCanvasElement
-
tintPerPixel(texture, color, canvas)
-
Tint a texture pixel per pixel.
Parameters:
Name Type Description textureTexture the texture to tint
colorNumber the color to use to tint the sprite with
canvasHTMLCanvasElement the current canvas
-
tintWithMultiply(texture, color, canvas)
-
Tint a texture using the "multiply" operation.
Parameters:
Name Type Description textureTexture the texture to tint
colorNumber the color to use to tint the sprite with
canvasHTMLCanvasElement the current canvas