CanvasTinter Class
Constructor
CanvasTinter
()
static
Item Index
Methods
getTintedTexture
-
sprite -
color
Basically this method just needs a sprite and a color and tints the sprite with the given color.
Parameters:
-
spriteSpritethe sprite to tint
-
colorNumberthe color to use to tint the sprite with
Returns:
The tinted canvas
roundColor
-
color
Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel.
Parameters:
-
colorNumberthe color to round, should be a hex color
tintMethod
()
The tinting method that will be used.
tintPerPixel
-
texture -
color -
canvas
Tint a texture pixel per pixel.
Parameters:
-
textureTexturethe texture to tint
-
colorNumberthe color to use to tint the sprite with
-
canvasHTMLCanvasElementthe current canvas
tintWithMultiply
-
texture -
color -
canvas
Tint a texture using the "multiply" operation.
Parameters:
-
textureTexturethe texture to tint
-
colorNumberthe color to use to tint the sprite with
-
canvasHTMLCanvasElementthe current canvas
tintWithOverlay
-
texture -
color -
canvas
Tint a texture using the "overlay" operation.
Parameters:
-
textureTexturethe texture to tint
-
colorNumberthe color to use to tint the sprite with
-
canvasHTMLCanvasElementthe current canvas
Properties
cacheStepsPerColorChannel
Number
Number of steps which will be used as a cap when rounding colors.
canUseMultiply
Boolean
Whether or not the Canvas BlendModes are supported, consequently the ability to tint using the multiply method.
convertTintToImage
Boolean
Tint cache boolean flag.
