mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Fixed docs and ended batch if rendering.
This commit is contained in:
parent
cdad93e0ca
commit
1d56c360af
1 changed files with 20 additions and 7 deletions
|
@ -248,18 +248,31 @@ var SpineGameObject = new Class({
|
||||||
* @method SpineGameObject#willRender
|
* @method SpineGameObject#willRender
|
||||||
* @since 3.19.0
|
* @since 3.19.0
|
||||||
*
|
*
|
||||||
|
* @param {Phaser.Cameras.Scene2D.Camera} camera - The Camera that is rendering the Game Object.
|
||||||
|
* @param {SpineContainer} [container] - If this Spine object is in a Spine Container, this is a reference to it.
|
||||||
|
*
|
||||||
* @return {boolean} `true` if this Game Object should be rendered, otherwise `false`.
|
* @return {boolean} `true` if this Game Object should be rendered, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
willRender: function (camera)
|
willRender: function (camera, container)
|
||||||
{
|
{
|
||||||
if (!this.skeleton)
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
var GameObjectRenderMask = 15;
|
var GameObjectRenderMask = 15;
|
||||||
|
|
||||||
return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)));
|
var result = (!this.skeleton || !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id))));
|
||||||
|
|
||||||
|
if (!container && !result)
|
||||||
|
{
|
||||||
|
var plugin = this.plugin;
|
||||||
|
var sceneRenderer = plugin.sceneRenderer;
|
||||||
|
|
||||||
|
if (plugin.gl && sceneRenderer.batcher.isDrawing)
|
||||||
|
{
|
||||||
|
sceneRenderer.end();
|
||||||
|
|
||||||
|
plugin.renderer.pipelines.rebind();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue