diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 6e8a0ad..25b5a0e 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -203,7 +203,7 @@ if (this._mask) { - renderer.maskManager.pushMask(this._mask, context); + renderer.maskManager.pushMask(this._mask, renderer); } context.globalAlpha = this.worldAlpha; @@ -264,7 +264,7 @@ if (this._mask) { - renderer.maskManager.popMask(renderer.context); + renderer.maskManager.popMask(renderer); } for (i = 0, j = this.children.length; i < j; ++i) diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 6e8a0ad..25b5a0e 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -203,7 +203,7 @@ if (this._mask) { - renderer.maskManager.pushMask(this._mask, context); + renderer.maskManager.pushMask(this._mask, renderer); } context.globalAlpha = this.worldAlpha; @@ -264,7 +264,7 @@ if (this._mask) { - renderer.maskManager.popMask(renderer.context); + renderer.maskManager.popMask(renderer); } for (i = 0, j = this.children.length; i < j; ++i) diff --git a/src/index.js b/src/index.js index 9910c8d..f864027 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,6 @@ core.extras = require('./extras'); core.filters = require('./filters'); core.interaction = require('./interaction'); -//core.loaders = require('./loaders'); -//core.spine = require('./spine'); +core.loaders = require('./loaders'); +core.spine = require('./spine'); core.text = require('./text'); diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 6e8a0ad..25b5a0e 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -203,7 +203,7 @@ if (this._mask) { - renderer.maskManager.pushMask(this._mask, context); + renderer.maskManager.pushMask(this._mask, renderer); } context.globalAlpha = this.worldAlpha; @@ -264,7 +264,7 @@ if (this._mask) { - renderer.maskManager.popMask(renderer.context); + renderer.maskManager.popMask(renderer); } for (i = 0, j = this.children.length; i < j; ++i) diff --git a/src/index.js b/src/index.js index 9910c8d..f864027 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,6 @@ core.extras = require('./extras'); core.filters = require('./filters'); core.interaction = require('./interaction'); -//core.loaders = require('./loaders'); -//core.spine = require('./spine'); +core.loaders = require('./loaders'); +core.spine = require('./spine'); core.text = require('./text'); diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 6320ae4..d12425e 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, core = require('../core'); module.exports = function () diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 6e8a0ad..25b5a0e 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -203,7 +203,7 @@ if (this._mask) { - renderer.maskManager.pushMask(this._mask, context); + renderer.maskManager.pushMask(this._mask, renderer); } context.globalAlpha = this.worldAlpha; @@ -264,7 +264,7 @@ if (this._mask) { - renderer.maskManager.popMask(renderer.context); + renderer.maskManager.popMask(renderer); } for (i = 0, j = this.children.length; i < j; ++i) diff --git a/src/index.js b/src/index.js index 9910c8d..f864027 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,6 @@ core.extras = require('./extras'); core.filters = require('./filters'); core.interaction = require('./interaction'); -//core.loaders = require('./loaders'); -//core.spine = require('./spine'); +core.loaders = require('./loaders'); +core.spine = require('./spine'); core.text = require('./text'); diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 6320ae4..d12425e 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, core = require('../core'); module.exports = function () diff --git a/src/loaders/index.js b/src/loaders/index.js index c269ffb..a3a8db4 100644 --- a/src/loaders/index.js +++ b/src/loaders/index.js @@ -9,11 +9,12 @@ * @namespace PIXI */ module.exports = { - Loader: require('asset-loader'), + Loader: require('resource-loader'), loader: require('./loader'), // parsers - textureParser: require('./textureParser'), + bitmapFontParser: require('./bitmapFontParser'), + spineAtlasParser: require('./spineAtlasParser'), spritesheetParser: require('./spritesheetParser'), - spineAtlasParser: require('./spineAtlasParser') + textureParser: require('./textureParser') }; diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 6e8a0ad..25b5a0e 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -203,7 +203,7 @@ if (this._mask) { - renderer.maskManager.pushMask(this._mask, context); + renderer.maskManager.pushMask(this._mask, renderer); } context.globalAlpha = this.worldAlpha; @@ -264,7 +264,7 @@ if (this._mask) { - renderer.maskManager.popMask(renderer.context); + renderer.maskManager.popMask(renderer); } for (i = 0, j = this.children.length; i < j; ++i) diff --git a/src/index.js b/src/index.js index 9910c8d..f864027 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,6 @@ core.extras = require('./extras'); core.filters = require('./filters'); core.interaction = require('./interaction'); -//core.loaders = require('./loaders'); -//core.spine = require('./spine'); +core.loaders = require('./loaders'); +core.spine = require('./spine'); core.text = require('./text'); diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 6320ae4..d12425e 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, core = require('../core'); module.exports = function () diff --git a/src/loaders/index.js b/src/loaders/index.js index c269ffb..a3a8db4 100644 --- a/src/loaders/index.js +++ b/src/loaders/index.js @@ -9,11 +9,12 @@ * @namespace PIXI */ module.exports = { - Loader: require('asset-loader'), + Loader: require('resource-loader'), loader: require('./loader'), // parsers - textureParser: require('./textureParser'), + bitmapFontParser: require('./bitmapFontParser'), + spineAtlasParser: require('./spineAtlasParser'), spritesheetParser: require('./spritesheetParser'), - spineAtlasParser: require('./spineAtlasParser') + textureParser: require('./textureParser') }; diff --git a/src/loaders/spineAtlasParser.js b/src/loaders/spineAtlasParser.js index ce636c8..3083c4a 100644 --- a/src/loaders/spineAtlasParser.js +++ b/src/loaders/spineAtlasParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, async = require('async'), spine = require('../spine'); diff --git a/examples/example 1 - Basics/mark.html b/examples/example 1 - Basics/mark.html deleted file mode 100644 index b71350c..0000000 --- a/examples/example 1 - Basics/mark.html +++ /dev/null @@ -1,150 +0,0 @@ - - - - - - Pixi.js - Basic Usage - - - - - - - - -
- - -
- - -
- - - - diff --git a/examples/example 1 - Basics/stats.min.js b/examples/example 1 - Basics/stats.min.js deleted file mode 100644 index 52539f4..0000000 --- a/examples/example 1 - Basics/stats.min.js +++ /dev/null @@ -1,6 +0,0 @@ -// stats.js - http://github.com/mrdoob/stats.js -var Stats=function(){var l=Date.now(),m=l,g=0,n=Infinity,o=0,h=0,p=Infinity,q=0,r=0,s=0,f=document.createElement("div");f.id="stats";f.addEventListener("mousedown",function(b){b.preventDefault();t(++s%2)},!1);f.style.cssText="width:80px;opacity:0.9;cursor:pointer";var a=document.createElement("div");a.id="fps";a.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#002";f.appendChild(a);var i=document.createElement("div");i.id="fpsText";i.style.cssText="color:#0ff;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px"; -i.innerHTML="FPS";a.appendChild(i);var c=document.createElement("div");c.id="fpsGraph";c.style.cssText="position:relative;width:74px;height:30px;background-color:#0ff";for(a.appendChild(c);74>c.children.length;){var j=document.createElement("span");j.style.cssText="width:1px;height:30px;float:left;background-color:#113";c.appendChild(j)}var d=document.createElement("div");d.id="ms";d.style.cssText="padding:0 0 3px 3px;text-align:left;background-color:#020;display:none";f.appendChild(d);var k=document.createElement("div"); -k.id="msText";k.style.cssText="color:#0f0;font-family:Helvetica,Arial,sans-serif;font-size:9px;font-weight:bold;line-height:15px";k.innerHTML="MS";d.appendChild(k);var e=document.createElement("div");e.id="msGraph";e.style.cssText="position:relative;width:74px;height:30px;background-color:#0f0";for(d.appendChild(e);74>e.children.length;)j=document.createElement("span"),j.style.cssText="width:1px;height:30px;float:left;background-color:#131",e.appendChild(j);var t=function(b){s=b;switch(s){case 0:a.style.display= -"block";d.style.display="none";break;case 1:a.style.display="none",d.style.display="block"}};return{REVISION:12,domElement:f,setMode:t,begin:function(){l=Date.now()},end:function(){var b=Date.now();g=b-l;n=Math.min(n,g);o=Math.max(o,g);k.textContent=g+" MS ("+n+"-"+o+")";var a=Math.min(30,30-30*(g/200));e.appendChild(e.firstChild).style.height=a+"px";r++;b>m+1E3&&(h=Math.round(1E3*r/(b-m)),p=Math.min(p,h),q=Math.max(q,h),i.textContent=h+" FPS ("+p+"-"+q+")",a=Math.min(30,30-30*(h/100)),c.appendChild(c.firstChild).style.height= -a+"px",m=b,r=0);return b},update:function(){l=this.end()}}};"object"===typeof module&&(module.exports=Stats); diff --git a/gulp/util/bundle.js b/gulp/util/bundle.js index a65e5c4..e472698 100644 --- a/gulp/util/bundle.js +++ b/gulp/util/bundle.js @@ -27,7 +27,15 @@ args.debug = true; args.standalone = 'PIXI'; - return browserify(paths.jsEntry, args); + var bundle = browserify(paths.jsEntry, args), + argv = require('minimist')(process.argv.slice(2)), + exclude = (argv.exclude || []).concat(argv.e || []); + + for (var i = 0; i < exclude.length; ++i) { + bundle.ignore('./' + exclude[i]); + } + + return bundle; } function watch(onUpdate) { diff --git a/package.json b/package.json index f891a71..51217d5 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "karma-firefox-launcher": "^0.1.0", "karma-mocha": "^0.1.10", "karma-spec-reporter": "^0.0.16", + "minimist": "^1.1.0", "mocha": "^2.1.0", "require-dir": "^0.1.0", "run-sequence": "^1.0.2", @@ -46,6 +47,7 @@ "watchify": "^2.2.1" }, "dependencies": { + "async": "^0.9.0", "resource-loader": "^1.0.0", "webgl-enabled": "^1.0.2" }, diff --git a/src/core/display/Container.js b/src/core/display/Container.js index 0595cd5..6481ad1 100644 --- a/src/core/display/Container.js +++ b/src/core/display/Container.js @@ -421,7 +421,7 @@ 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) + if (this.isMask || !this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -493,7 +493,7 @@ */ Container.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } diff --git a/src/core/graphics/Graphics.js b/src/core/graphics/Graphics.js index baeb1de..7b7421a 100644 --- a/src/core/graphics/Graphics.js +++ b/src/core/graphics/Graphics.js @@ -761,7 +761,7 @@ Graphics.prototype.renderCanvas = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0 || this.isMask === true) + if (!this.visible || this.alpha <= 0 || this.isMask === true || !this.renderable) { return; } diff --git a/src/core/particles/ParticleContainer.js b/src/core/particles/ParticleContainer.js index 9a85e36..e5dfa63 100644 --- a/src/core/particles/ParticleContainer.js +++ b/src/core/particles/ParticleContainer.js @@ -58,17 +58,14 @@ */ ParticleContainer.prototype.renderWebGL = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } renderer.setObjectRenderer( renderer.plugins.particle ); - - renderer.plugins.particle.render( this ); - }; ParticleContainer.prototype.addChildAt = function (child, index) @@ -125,7 +122,7 @@ */ ParticleContainer.prototype.renderCanvas = function (renderer) { - if (!this.visible || this.alpha <= 0 || !this.children.length) + if (!this.visible || this.alpha <= 0 || !this.children.length || !this.renderable) { return; } diff --git a/src/core/renderers/SystemRenderer.js b/src/core/renderers/SystemRenderer.js index b271eac..bb70cdc 100644 --- a/src/core/renderers/SystemRenderer.js +++ b/src/core/renderers/SystemRenderer.js @@ -155,7 +155,6 @@ SystemRenderer.prototype.constructor = SystemRenderer; module.exports = SystemRenderer; -utils.pluginTarget.mixin(SystemRenderer); utils.eventTarget.mixin(SystemRenderer.prototype); Object.defineProperties(SystemRenderer.prototype, { @@ -232,6 +231,4 @@ this._backgroundColor = 0; this._backgroundColorRgb = null; this._backgroundColorString = null; - - this.destroyPlugins(); }; diff --git a/src/core/renderers/canvas/CanvasRenderer.js b/src/core/renderers/canvas/CanvasRenderer.js index 716cd0e..2fea16b 100644 --- a/src/core/renderers/canvas/CanvasRenderer.js +++ b/src/core/renderers/canvas/CanvasRenderer.js @@ -114,7 +114,7 @@ } // constructor -CanvasRenderer.prototype = Object.create(SystemRenderer); +CanvasRenderer.prototype = Object.create(SystemRenderer.prototype); CanvasRenderer.prototype.constructor = CanvasRenderer; module.exports = CanvasRenderer; diff --git a/src/core/renderers/webgl/WebGLRenderer.js b/src/core/renderers/webgl/WebGLRenderer.js index ed50aac..33edbbb 100644 --- a/src/core/renderers/webgl/WebGLRenderer.js +++ b/src/core/renderers/webgl/WebGLRenderer.js @@ -124,7 +124,7 @@ } // constructor -WebGLRenderer.prototype = Object.create(SystemRenderer); +WebGLRenderer.prototype = Object.create(SystemRenderer.prototype); WebGLRenderer.prototype.constructor = WebGLRenderer; module.exports = WebGLRenderer; utils.pluginTarget.mixin(WebGLRenderer); @@ -132,6 +132,8 @@ WebGLRenderer.glContextId = 0; +utils.pluginTarget.mixin(WebGLRenderer); + /** * * @private @@ -377,6 +379,8 @@ */ WebGLRenderer.prototype.destroy = function (removeView) { + this.destroyPlugins(); + // remove listeners this.view.removeEventListener('webglcontextlost', this._boundContextLost); this.view.removeEventListener('webglcontextrestored', this._boundContextRestored); diff --git a/src/core/textures/RenderTexture.js b/src/core/textures/RenderTexture.js index 64acb8d..0d132c6 100644 --- a/src/core/textures/RenderTexture.js +++ b/src/core/textures/RenderTexture.js @@ -139,7 +139,7 @@ */ this.renderer = renderer; - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; @@ -194,7 +194,7 @@ this.baseTexture.height = this.height; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.projection.x = this.width / 2; this.projection.y = -this.height / 2; @@ -219,7 +219,7 @@ return; } - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { this.renderer.gl.bindFramebuffer(this.renderer.gl.FRAMEBUFFER, this.textureBuffer.frameBuffer); } @@ -402,7 +402,7 @@ */ RenderTexture.prototype.getCanvas = function () { - if (this.renderer.type === CONST.WEBGL_RENDERER) + if (this.renderer.type === CONST.RENDERER_TYPE.WEBGL) { var gl = this.renderer.gl; var width = this.textureBuffer.width; diff --git a/src/extras/Strip.js b/src/extras/Strip.js index 113ef8f..ff3cfbe 100644 --- a/src/extras/Strip.js +++ b/src/extras/Strip.js @@ -74,7 +74,7 @@ Strip.prototype.renderWebGL = function (renderer) { // if the sprite is not visible or the alpha is 0 then no need to render this element - if (!this.visible || this.alpha <= 0) + if (!this.visible || this.alpha <= 0 || !this.renderable) { return; } @@ -217,6 +217,12 @@ */ Strip.prototype.renderCanvas = function (renderer) { + // if the sprite is not visible or the alpha is 0 then no need to render this element + if (!this.visible || this.alpha <= 0 || !this.renderable) + { + return; + } + var context = renderer.context; var transform = this.worldTransform; diff --git a/src/extras/TilingSprite.js b/src/extras/TilingSprite.js index 6e8a0ad..25b5a0e 100644 --- a/src/extras/TilingSprite.js +++ b/src/extras/TilingSprite.js @@ -203,7 +203,7 @@ if (this._mask) { - renderer.maskManager.pushMask(this._mask, context); + renderer.maskManager.pushMask(this._mask, renderer); } context.globalAlpha = this.worldAlpha; @@ -264,7 +264,7 @@ if (this._mask) { - renderer.maskManager.popMask(renderer.context); + renderer.maskManager.popMask(renderer); } for (i = 0, j = this.children.length; i < j; ++i) diff --git a/src/index.js b/src/index.js index 9910c8d..f864027 100644 --- a/src/index.js +++ b/src/index.js @@ -4,6 +4,6 @@ core.extras = require('./extras'); core.filters = require('./filters'); core.interaction = require('./interaction'); -//core.loaders = require('./loaders'); -//core.spine = require('./spine'); +core.loaders = require('./loaders'); +core.spine = require('./spine'); core.text = require('./text'); diff --git a/src/loaders/bitmapFontParser.js b/src/loaders/bitmapFontParser.js index 6320ae4..d12425e 100644 --- a/src/loaders/bitmapFontParser.js +++ b/src/loaders/bitmapFontParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, core = require('../core'); module.exports = function () diff --git a/src/loaders/index.js b/src/loaders/index.js index c269ffb..a3a8db4 100644 --- a/src/loaders/index.js +++ b/src/loaders/index.js @@ -9,11 +9,12 @@ * @namespace PIXI */ module.exports = { - Loader: require('asset-loader'), + Loader: require('resource-loader'), loader: require('./loader'), // parsers - textureParser: require('./textureParser'), + bitmapFontParser: require('./bitmapFontParser'), + spineAtlasParser: require('./spineAtlasParser'), spritesheetParser: require('./spritesheetParser'), - spineAtlasParser: require('./spineAtlasParser') + textureParser: require('./textureParser') }; diff --git a/src/loaders/spineAtlasParser.js b/src/loaders/spineAtlasParser.js index ce636c8..3083c4a 100644 --- a/src/loaders/spineAtlasParser.js +++ b/src/loaders/spineAtlasParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, async = require('async'), spine = require('../spine'); diff --git a/src/loaders/spritesheetParser.js b/src/loaders/spritesheetParser.js index 934e1d7..2d778b7 100644 --- a/src/loaders/spritesheetParser.js +++ b/src/loaders/spritesheetParser.js @@ -1,4 +1,4 @@ -var Resource = require('asset-loader').Resource, +var Resource = require('resource-loader').Resource, core = require('../core'); module.exports = function ()