mirror of
https://github.com/photonstorm/phaser
synced 2025-02-17 06:28:30 +00:00
setBlendMode now returns a boolean
This commit is contained in:
parent
fc5eb2511c
commit
521138e9d8
1 changed files with 10 additions and 6 deletions
|
@ -880,22 +880,24 @@ var WebGLRenderer = new Class({
|
|||
},
|
||||
|
||||
/**
|
||||
* [description]
|
||||
* Sets the blend mode to the value given.
|
||||
*
|
||||
* If the current blend mode is different from the one given, the pipeline is flushed and the new
|
||||
* blend mode is enabled.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#setBlendMode
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {integer} blendModeId - [description]
|
||||
* @param {integer} blendModeId - The blend mode to be set. Can be a `BlendModes` const or an integer value.
|
||||
*
|
||||
* @return {Phaser.Renderer.WebGL.WebGLRenderer} [description]
|
||||
* @return {boolean} `true` if the blend mode was changed as a result of this call, forcing a flush, otherwise `false`.
|
||||
*/
|
||||
setBlendMode: function (blendModeId)
|
||||
{
|
||||
var gl = this.gl;
|
||||
var blendMode = this.blendModes[blendModeId];
|
||||
|
||||
if (blendModeId !== CONST.BlendModes.SKIP_CHECK &&
|
||||
this.currentBlendMode !== blendModeId)
|
||||
if (blendModeId !== CONST.BlendModes.SKIP_CHECK && this.currentBlendMode !== blendModeId)
|
||||
{
|
||||
this.flush();
|
||||
|
||||
|
@ -912,9 +914,11 @@ var WebGLRenderer = new Class({
|
|||
}
|
||||
|
||||
this.currentBlendMode = blendModeId;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return this;
|
||||
return false;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Reference in a new issue