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:
| name | type | optional | default | description |
|---|---|---|---|---|
| renderer | Phaser.Renderer.WebGL.WebGLRenderer | No | The WebGLRenderer to create the WebGLBlendParameters for. | |
| enabled | GLboolean | Yes | true | Whether blending is enabled. |
| color | Array.<GLclampf> | Yes | "[0, 0, 0, 0]" | The blend color (array of 4 channels, 0-1). |
| equation | GLenum | Yes | "gl.FUNC_ADD" | The blend equation. |
| funcSrc | GLenum | Yes | "gl.ONE" | The source blend function. |
| funcDst | GLenum | Yes | "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:
| name | type | optional | default | description |
|---|---|---|---|---|
| renderer | Phaser.Renderer.WebGL.WebGLRenderer | No | The WebGLRenderer to create the WebGLBlendParameters for. | |
| enabled | GLboolean | Yes | true | Whether blending is enabled. |
| color | Array.<GLclampf> | Yes | "[0, 0, 0, 0]" | The blend color (array of 4 channels, 0-1). |
| equationRGB | GLenum | Yes | "gl.FUNC_ADD" | The RGB blend equation. |
| equationAlpha | GLenum | Yes | "gl.FUNC_ADD" | The alpha blend equation. |
| funcSrcRGB | GLenum | Yes | "gl.ONE" | The RGB source blend function. |
| funcDstRGB | GLenum | Yes | "gl.ONE_MINUS_SRC_ALPHA" | The RGB destination blend function. |
| funcSrcAlpha | GLenum | Yes | "gl.ONE" | The alpha source blend function. |
| funcDstAlpha | GLenum | Yes | "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