mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 21:53:59 +00:00
SpineGameObject.willRender
is no longer hard-coded to return true
. It instead now takes a Camera parameter and performs all of the checks needed before returning. Previously, this happened during the render functions.
This commit is contained in:
parent
d35ff331b2
commit
67f24ea363
1 changed files with 15 additions and 5 deletions
|
@ -242,17 +242,27 @@ var SpineGameObject = new Class({
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Overrides the default Game Object method and always returns true.
|
* Returns `true` if this Spine Game Object both has a skeleton and
|
||||||
* Rendering is decided in the renderer functions.
|
* also passes the render tests for the given Camera.
|
||||||
*
|
*
|
||||||
* @method SpineGameObject#willRender
|
* @method SpineGameObject#willRender
|
||||||
* @since 3.19.0
|
* @since 3.19.0
|
||||||
*
|
*
|
||||||
* @return {boolean} Always returns `true`.
|
* @return {boolean} `true` if this Game Object should be rendered, otherwise `false`.
|
||||||
*/
|
*/
|
||||||
willRender: function ()
|
willRender: function (camera)
|
||||||
{
|
{
|
||||||
return true;
|
var skeleton = this.skeleton;
|
||||||
|
|
||||||
|
if (!skeleton)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var GameObjectRenderMask = 15;
|
||||||
|
var childAlpha = skeleton.color.a;
|
||||||
|
|
||||||
|
return !(GameObjectRenderMask !== this.renderFlags || (this.cameraFilter !== 0 && (this.cameraFilter & camera.id)) || childAlpha === 0);
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue