Skip to main content
Version: Phaser v4.0.0-rc.6

Phaser.Renderer.WebGL.WebGLBlendParametersFactory

Scope: static

Source: src/renderer/webgl/parameters/WebGLBlendParametersFactory.js#L7
Since: 4.0.0

Static functions

createCombined

<instance> createCombined(renderer, [enabled], [color], [equation], [funcSrc], [funcDst])

Description:

Create a new WebGLBlendParameters object.

Default values are for a normal blend mode.

  • enabled: true

  • color: [ 0, 0, 0, 0 ]

  • equation: gl.FUNC_ADD

  • funcSrc: gl.ONE

  • funcDst: gl.ONE_MINUS_SRC_ALPHA

Where equation, funcSrc, and funcDst are the same for RGB and alpha.

Parameters:

nametypeoptionaldefaultdescription
rendererPhaser.Renderer.WebGL.WebGLRendererNoThe WebGLRenderer to create the WebGLBlendParameters for.
enabledGLbooleanYestrueWhether blending is enabled.
colorArray.<GLclampf>Yes"[0, 0, 0, 0]"The blend color (array of 4 channels, 0-1).
equationGLenumYes"gl.FUNC_ADD"The blend equation.
funcSrcGLenumYes"gl.ONE"The source blend function.
funcDstGLenumYes"gl.ONE_MINUS_SRC_ALPHA"The destination blend function.

Returns: Phaser.Types.Renderer.WebGL.WebGLBlendParameters - The created WebGLBlendParameters.

Source: src/renderer/webgl/parameters/WebGLBlendParametersFactory.js#L15
Since: 4.0.0


createSeparate

<instance> createSeparate(renderer, [enabled], [color], [equationRGB], [equationAlpha], [funcSrcRGB], [funcDstRGB], [funcSrcAlpha], [funcDstAlpha])

Description:

Create a new WebGLBlendParameters object.

Default values are for a normal blend mode.

  • enabled: true

  • color: [ 0, 0, 0, 0 ]

  • equation: gl.FUNC_ADD

  • funcSrc: gl.ONE

  • funcDst: gl.ONE_MINUS_SRC_ALPHA

Where equation, funcSrc, and funcDst are the same for RGB and alpha.

Parameters:

nametypeoptionaldefaultdescription
rendererPhaser.Renderer.WebGL.WebGLRendererNoThe WebGLRenderer to create the WebGLBlendParameters for.
enabledGLbooleanYestrueWhether blending is enabled.
colorArray.<GLclampf>Yes"[0, 0, 0, 0]"The blend color (array of 4 channels, 0-1).
equationRGBGLenumYes"gl.FUNC_ADD"The RGB blend equation.
equationAlphaGLenumYes"gl.FUNC_ADD"The alpha blend equation.
funcSrcRGBGLenumYes"gl.ONE"The RGB source blend function.
funcDstRGBGLenumYes"gl.ONE_MINUS_SRC_ALPHA"The RGB destination blend function.
funcSrcAlphaGLenumYes"gl.ONE"The alpha source blend function.
funcDstAlphaGLenumYes"gl.ONE_MINUS_SRC_ALPHA"The alpha destination blend function.

Returns: Phaser.Types.Renderer.WebGL.WebGLBlendParameters - The created WebGLBlendParameters.

Source: src/renderer/webgl/parameters/WebGLBlendParametersFactory.js#L55
Since: 4.0.0