API Docs for: 2.2.1
Show:

CanvasGraphics Class

A set of functions used by the canvas renderer to draw the primitive graphics data

Methods

getTintedTexture

(
  • sprite
  • color
)

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

Parameters:

  • sprite Sprite

    the sprite to tint

  • color Float

    the color to use to tint the sprite with

roundColor

(
  • color
)

Rounds the specified color according to the PIXI.CanvasTinter.cacheStepsPerColorChannel

Parameters:

  • color Float

    the color to round, should be a hex color

tintPerPixel

(
  • texture
  • color
  • canvas
)

Tint a texture pixel per pixel

Parameters:

  • texture Texture

    the texture to tint

  • color Number

    the color to use to tint the sprite with

  • canvas HTMLCanvasElement

    the current canvas

tintWithMultiply

(
  • texture
  • color
  • canvas
)

Tint a texture using the "multiply" operation

Parameters:

  • texture Texture

    the texture to tint

  • color Int

    the color to use to tint the sprite with

  • canvas HTMLCanvasElement

    the current canvas

tintWithOverlay

(
  • texture
  • color
  • canvas
)

Tint a texture using the "overlay" operation

Parameters:

  • texture Texture

    the texture to tint

  • color Int

    the color to use to tint the sprite with

  • canvas HTMLCanvasElement

    the current canvas