PokéRogue
    Preparing search index...

    Interface BlendMode

    Provides methods used for setting the blend mode of a Game Object. Blend modes control how a Game Object is composited onto the display when rendered. They determine how the pixels of the object are blended with the pixels already on screen, enabling effects such as additive lighting, screen blending, and erasing.

    This component is designed to be applied as a mixin to Game Objects and should not be used directly. Any Game Object that mixes in this component gains the blendMode property and the setBlendMode method.

    interface BlendMode {
        blendMode: string | number | BlendModes;
        setBlendMode(value: string | number | BlendModes): this;
    }

    Implemented by

    Index
    blendMode: string | number | BlendModes

    Sets the Blend Mode being used by this Game Object.

    This can be a const, such as Phaser.BlendModes.SCREEN, or an integer, such as 4 (for Overlay)

    Under WebGL only the following Blend Modes are available:

    • NORMAL
    • ADD
    • MULTIPLY
    • SCREEN
    • ERASE

    Canvas has more available depending on browser support.

    You can also create your own custom Blend Modes in WebGL.

    Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these reasons try to be careful about the construction of your Scene and the frequency with which blend modes are used.

    • Sets the Blend Mode being used by this Game Object.

      This can be a const, such as Phaser.BlendModes.SCREEN, or an integer, such as 4 (for Overlay)

      Under WebGL only the following Blend Modes are available:

      • NORMAL
      • ADD
      • MULTIPLY
      • SCREEN
      • ERASE (only works when rendering to a framebuffer, like a Render Texture)

      Canvas has more available depending on browser support.

      You can also create your own custom Blend Modes in WebGL.

      Blend modes have different effects under Canvas and WebGL, and from browser to browser, depending on support. Blend Modes also cause a WebGL batch flush should it encounter a new blend mode. For these reasons try to be careful about the construction of your Scene and the frequency with which blend modes are used.

      Parameters

      • value: string | number | BlendModes

        The BlendMode value. Either a string, a CONST or a number.

      Returns this

      This Game Object instance.