diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 6481ad1..5f12eda 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -126,7 +126,6 @@ child.parent = this; this.children.splice(index, 0, child); - return child; } else @@ -420,8 +419,9 @@ */ Container.prototype.renderWebGL = function (renderer) { + // if the object is not visible or the alpha is 0 then no need to render this element - if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) + if (this.isMask || !this.visible || this.worldAlpha <= 0 || !this.renderable) { return; } diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 6481ad1..5f12eda 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -126,7 +126,6 @@ child.parent = this; this.children.splice(index, 0, child); - return child; } else @@ -420,8 +419,9 @@ */ Container.prototype.renderWebGL = function (renderer) { + // if the object is not visible or the alpha is 0 then no need to render this element - if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) + if (this.isMask || !this.visible || this.worldAlpha <= 0 || !this.renderable) { return; } diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index e768ac8..fe2c0b0 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -1,4 +1,5 @@ -var math = require('../math'); +var math = require('../math'), + utils = require('../utils'); /** * The base class for all objects that are rendered on the screen. @@ -58,7 +59,7 @@ * * @member {boolean} */ - this.renderable = false; + this.renderable = true; /** * The display object container that contains this display object. @@ -132,7 +133,8 @@ */ this._mask = null; - this._isMask = false; + //TODO rename to _isMask + this.isMask = false; /** * Cached internal flag. @@ -141,10 +143,13 @@ * @private */ this._cacheIsDirty = false; + + // this.cacheAsBitmap = false; } // constructor DisplayObject.prototype.constructor = DisplayObject; +utils.eventTarget.mixin(DisplayObject.prototype); module.exports = DisplayObject; Object.defineProperties(DisplayObject.prototype, { @@ -332,6 +337,9 @@ DisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform; /** + * + * + * * Retrieves the bounds of the displayObject as a rectangle object * * @param matrix {Matrix} diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 6481ad1..5f12eda 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -126,7 +126,6 @@ child.parent = this; this.children.splice(index, 0, child); - return child; } else @@ -420,8 +419,9 @@ */ Container.prototype.renderWebGL = function (renderer) { + // if the object is not visible or the alpha is 0 then no need to render this element - if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) + if (this.isMask || !this.visible || this.worldAlpha <= 0 || !this.renderable) { return; } diff --git a/src/core/display/DisplayObject.js b/src/core/display/DisplayObject.js index e768ac8..fe2c0b0 100644 --- a/src/core/display/DisplayObject.js +++ b/src/core/display/DisplayObject.js @@ -1,4 +1,5 @@ -var math = require('../math'); +var math = require('../math'), + utils = require('../utils'); /** * The base class for all objects that are rendered on the screen. @@ -58,7 +59,7 @@ * * @member {boolean} */ - this.renderable = false; + this.renderable = true; /** * The display object container that contains this display object. @@ -132,7 +133,8 @@ */ this._mask = null; - this._isMask = false; + //TODO rename to _isMask + this.isMask = false; /** * Cached internal flag. @@ -141,10 +143,13 @@ * @private */ this._cacheIsDirty = false; + + // this.cacheAsBitmap = false; } // constructor DisplayObject.prototype.constructor = DisplayObject; +utils.eventTarget.mixin(DisplayObject.prototype); module.exports = DisplayObject; Object.defineProperties(DisplayObject.prototype, { @@ -332,6 +337,9 @@ DisplayObject.prototype.displayObjectUpdateTransform = DisplayObject.prototype.updateTransform; /** + * + * + * * Retrieves the bounds of the displayObject as a rectangle object * * @param matrix {Matrix} diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index af644fe..bf7d423 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -59,9 +59,9 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) + if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) { - return; + // return; } renderer.setObjectRenderer( renderer.plugins.particle ); @@ -123,7 +123,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) + if (!this.visible || this.worldAlpha <= 0 || !this.children.length || !this.renderable) { return; }